Modems

  • Thread starter Thread starter Guest
  • Start date Start date
How do i get a list of modems that are connectes to my ports?

Slightly modified from http://www.vbfrance.com/code.aspx?ID=20345

---snip---
Private Sub LoadModemList()
Try
Dim mngSearch As New ManagementObjectSearcher("Select *
From Win32_POTSModem")
Dim mngColl As ManagementObjectCollection = mngSearch.Get
Dim mngObj As ManagementObject

For Each mngObj In mngColl
Debug.WriteLine(CType(mngObj.Item("AttachedTo"),
String) & " - " & CType(mngObj.Item("Name"), String))
Next

Catch ex As Exception

End Try

End Sub
---snip---

Remember to add a reference to System.Management in your project
in order to access the objects in the System.Management namespace.

The sample is nearly two years old. Perhaps there is something better
in VS2005?

/Joergen Bech
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top