/* CODE BEGIN */
using System;
using System.Management;
public class network
{
public static void Main()
{
SelectQuery query = new SelectQuery( "select name, FreeSpace from
win32_logicaldisk where drivetype=3" );
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach( ManagementObject mo in searcher.Get() )
{
Console.WriteLine( "Drive letter is: {0}", mo["name"] );
Console.WriteLine( "Drive's free space is: {0}", mo["FreeSpace"] );
}
// Here to stop app from closing
Console.WriteLine( "\n\nPress Return to exit." );
Console.Read();
}
}
/* CODE END */
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.