I'm detecting the insertion of memory cards (removable media). Can I get information about the inserted media - type, manufacturer, etc?
+1
A:
You ought to be able to use WMI to query the Win32_PhysicalMedia type and get the information you want.
Here is a basic code example of how to do a general query on the class:
ManagementObjectSearcher searcher = new
ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia");
foreach (ManagementObject wmiObject in searcher.Get())
{
if (wmiObject["Manufacturer"] == null)
Console.WriteLine("Unknown");
else
Console.WriteLine(wmiObject["Manufacturer"].ToString());
}
Nick
2010-03-10 20:43:41
Thanks Nick, I know how to use WMI in .NET :) Unfortunately, the class didn't expose any information regarding the memory card.
Sphynx
2010-03-10 21:28:11
@John - What about Win32_PhysicalMemory?
Nick
2010-03-10 21:39:15