Writing on USB Flash Memory

  • Thread starter Thread starter Sobhan.Vezzu
  • Start date Start date
S

Sobhan.Vezzu

Hi All,

In our application we have to copy some files onto USB flash memory.

I am not sure on how to achieve this? Any pointers or help would be
appreciated.

Regards
Sobhan
 
The USB flash memory is like any other drive with a FAT file system, so you
only have to know its unit letter and use the usual functions to write
files.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
In our application we have to copy some files onto USB flash memory.

You can access the USB drive like any other drive. 'FileCopy' can be used
to copy a file to the drive, for example.
 
I'm not sure if .NET provides that functionality natively. If not, you can
use WMI:

http://vbnet.mvps.org/index.html?code/wmi/win32_diskdrive.htm

Or:

Imports System
Imports System.Management
' Disktypes - NoRoot = 1; Removable = 2; LocalDisk = 3; Network = 4; CD
= 5; RAMDrive = 6;
Public Class Wmis
Public Shared Sub Main()
Dim disks As New ManagementClass("Win32_LogicalDisk")
Dim moc As ManagementObjectCollection = disks.GetInstances()
Dim mo As ManagementObject
For Each mo In moc
Console.WriteLine("Disk type : {0}", mo("DriveType").ToString())
Next mo
disks.Dispose()
End Sub 'Main
End Class

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top