Hey guys,
I'm trying to figure out the difference between these two ways of getting free disk space:
One uses a System.Management.ManagementObject:
and the other uses DriveInfo:
Is there a reason you'd use one versus the other?
Thanks a bunch!
prgmrgirl
I'm trying to figure out the difference between these two ways of getting free disk space:
One uses a System.Management.ManagementObject:
Code:
ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
disk.Get();
return disk["FreeSpace"]
and the other uses DriveInfo:
Code:
DriveInfo drive = new DriveInfo("C");
return drive.AvailableFreeSpace();
Is there a reason you'd use one versus the other?
Thanks a bunch!
prgmrgirl