i develop a desktop appllication in c sharp for sending sms,using gsm datacard(modem)
i want to get modem name and port no how can i get this device name and port no and other setting using c#
Ho to get i Device Port No. and Name
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hiren SoniRank #694 · 3.5K reputationPosted Aug 23, 2010, 1:50 AM EDT
add reference system.management from the com tab.
using System.Management
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_POTSModem");
foreach (ManagementObject mo in mos.Get())
{
// for modem name
listBox1.Items.Add(mo["Caption"].ToString());
// for modem port
listBox1.Items.Add(mo["AttachedTo"].ToString());
}
For more setting you can visit this link.
http://msdn.microsoft.com/en-us/library/aa394360(VS.85).aspx
Don't forget to accept answer