Getting Drive List and Drive Format using VB.NET

Posted by Initiotech under VB.NET category on | Views : 5492
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);

Hefin Dsouza

Comments or Responses

Login to post response