On Wed, 4 Jan 2006 06:09:03 -0800, gad <ga*@discussions.microsoft.com>
wrote:
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