DriveInfo[] LocalDrives = DriveInfo.GetDrives();
foreach (DriveInfo lDrive in LocalDrives)
{
Console.WriteLine(lDrive.RootDirectory...
Console.WriteLine( "Drive Label : " + lDrive.VolumeLabel);
Console.WriteLine("Type : " + lDrive.DriveType.ToString());
Console.WriteLine("-------------------...
}
the above will print all the drives and its type in the local machine.
this resides on System.IO namespace.
witht the "DriveType" enum we can fine its removable or fixed.
(I Hope this will help)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment