WMI will contain all the necessary information in the Win32_POTSModem class. In C # or .Net, you can use the System.Management namespace to query WMI.
Inside .Net, you can use MgmtclassGen.EXE from the platform SDK to create a class object that represents the WMI class.
The command line will look like this:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\mgmtclassgen.exe Win32_POTSModem /L CS /P c:\POTSModem\Win32_POTSModem.cs
and then you can use this in your code:
using System; using System.Collections.Generic; using System.Management; using ROOT.CIMV2.Win32; public class MyClass { public static void Main() { foreach (POTSModem modem in POTSModem.GetInstances()) { Console.WriteLine(modem.Description); } } }
The result is as follows:
ThinkPad Modem - Internal Modem Speed: 56000
You can also take a look at this article: CodeProject: how: (almost) everything in WMI through C # - part 3: hardware. . The author created a simple class wrapper around WMI objects like MgmtclassGen.exe, but all this is done for you.
source share