DriveInfo[] mydrives = DriveInfo.GetDrives();
foreach (DriveInfo mydrive in mydrives)
{
Console.WriteLine("Drive: {0}", mydrive.Name);
Console.WriteLine("Type: {0}", mydrive.DriveType);
}
Note:
- GetDrives() is a static( shared in VB.Net) method.
- DriveType enumeration has the following values:
CDRom - An optical drive. It can be CD-ROM, DVD, and so on.
Fixed - A fixed disk.
Network - A network mapped drive.
NoRootDirectory - A drive that does not have a root directory.
Ram - A RAM drive.
Removable - A drive that has removable media.
Unknown - The drive could not be determined
1 comment:
Plz..., can you show sample, how i can work with drive type RAM?
Post a Comment