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#
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hiren SoniPosted Aug 23, 2010, 5:50 AM
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