Al said:
After enumerating the logical drives, using GetLogicalDrives, I need to know
the Drive Types, ie. Floppy or Network.
Is it possible in C# to do this? Thanks in advance.
..NET hasn't any build-in support for getting the drive type.
You can use the Win API function GetDriveType for doing that.
[DllImport("Kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern uint GetDriveType(string lpRootPathName);
lpRootPathName is the root path of the drive
It returns the following:
public const uint DRIVE_UNKNOWN = 0 // unknow drive type
public const uint DRIVE_NO_ROOT_DIR = 1 // invalid root path was given
to the function
public const uint DRIVE_REMOVABLE = 2 // removeable drive like a floppy
public const uint DRIVE_FIXED = 3 // a fixed drive like a hard disk
public const uint DRIVE_REMOTE = 4 // a network drive
public const uint DRIVE_CDROM = 5 // a cd-rom drive
public const uint DRIVE_RAMDISK = 6 // a ram disk
Basti