I use the following code to get a list of all installed modems.
private List<MyModem> modems = new List<MyModem>();
var searcher = new ManagementObjectSearcher("SELECT * FROM
Win32_POTSModem");
var collection = searcher.Get();
// Loop over returned data
foreach (ManagementObject modemObject in collection)
{
var modem = new MyModem {Name = modemObject["Name"].ToString()};
// Add the modem to the array
modems.Add(modem);
}
This code is running without errors on many computers. Now one of our
customer have a problem with this code. His modem (AVM ISDN) will not
found. Before i change my code to WMI i use the RasEnumDevices() API.
The 'old way' to search all installed modems found the AVM modem. WMI
doesn't found the modem.
Is this a general problem of WMI? Must i change my new code back to
RasEnumDevices() or is there a other solution to use WMI?