Getting Drive List and Drive Format using VB.NET

Initiotech
Posted by Initiotech under VB.NET category on | Views : 4994
The following code will demonstrate how to retrive the Number of Drives in a Particular Computer. You can also get lots of more information of the Drives like Total Space and Available space.

Please Remember to add refference to System.IO namespace.

DriveInfo[] driv = DriveInfo.GetDrives();

foreach (DriveInfo d in driv)
{
Console.WriteLine("Drive Name :"+ d.Name);
Console.WriteLine("Drive Format :"+ d.DriveFormat);
}


Regards
Hefin Dsouza

Comments or Responses

Login to post response