Saturday, January 8, 2011

Find The Modem Which Is Attached to Computer

Here I will show you how you can get modem information using WMI and C#

Create new project - > now add reference  System.Management;

Code is:


using System.Management;


            ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_POTSModem");


            foreach (ManagementObject mo in mos.Get())
            {
                listBox1.Items.Add(mo["Caption"].ToString());

            }


If you use caption here, it will show the name of modem
If you want to get more information , you can refer this link:

http://msdn.microsoft.com/en-us/library/aa394360(VS.85).aspx

No comments:

Post a Comment