Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C#: Win32_POTSModem doesn't found all installed modems

57 views
Skip to first unread message

b_hea

unread,
Sep 29, 2010, 10:35:48 AM9/29/10
to
Hi

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?

0 new messages