I am using the following code to retrieve information about my local drive:
ManagementObject c_drive = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
c_drive.Get();
driveinfo_lbl.Text = "Type: " + c_drive["Mediatype"].ToString();
What I am curious about is “MediaType” – how do you convert that to something more meaningful than the number that is returned. I know you could do it with a struct, but I can’t find where the listing is for each value?
Thanks, R.
See this page, which defines the values for the MEDIA_TYPE enumeration used by
Win32_LogicalDisk.