G
Guest
If I have a drive letter I can get the the drive info from WMI like this
string ltrDr=theSharePath.Substring(0,2); // must be in form of "E:
string wackyQuery =string.Format("Win32_LogicalDisk.DeviceID=\"{0}\"",ltrDr)
ManagementObject DIdisk =new ManagementObject(wackyQuery)
DIdisk.Get()
qcShareSize= Convert.ToDouble(DIdisk["FreeSpace"])/1000000000; // in GigaByte
but if I just have the UNC what then ? What does WMI expect ??? I have not found any examples to map to drive ltr directly or simply use the UNC path.
Thanks Andrew:
string ltrDr=theSharePath.Substring(0,2); // must be in form of "E:
string wackyQuery =string.Format("Win32_LogicalDisk.DeviceID=\"{0}\"",ltrDr)
ManagementObject DIdisk =new ManagementObject(wackyQuery)
DIdisk.Get()
qcShareSize= Convert.ToDouble(DIdisk["FreeSpace"])/1000000000; // in GigaByte
but if I just have the UNC what then ? What does WMI expect ??? I have not found any examples to map to drive ltr directly or simply use the UNC path.
Thanks Andrew: