NameSpace:
using System.Management;
/**Add System.Management as reference from .Net component**/
ManagementObject diskSize = new ManagementObject("win32_logicaldisk.deviceid=\"" + DiveName+ "\"");
diskSize.Get();
string DS = "Disk Space in " + Path[0] + " is :" + diskSize["Size"] + " bytes";
string FS = "Free space in " + Path[0] + " is :" + diskSize["FreeSpace"] + " bytes";
double FreeSpac = Convert.ToDouble(diskSize["FreeSpace"]);
24.6.08
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment