jigdog
asked on
VB.NET WMI Does Not Detect Virtual COM Port
We were forced to use a USB-to-Serial adapter. The attached code will not recognize the 'virtual serial port.' Any way around this? Or is this the way it is going to be when not using a 'TRUE' serial port?
Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject
moSearch = New Management.ManagementObjectSearcher("Select * from Win32_SerialPort")
moReturn = moSearch.Get
Dim Coms As New System.Collections.Specialized.StringCollection
For Each mo In moReturn
Coms.Add(CStr(mo.Properties.Item("DeviceID").Value))
Debug.WriteLine("-----------------------------------")
Debug.WriteLine("Win32_SerialPort instance")
Debug.WriteLine("-----------------------------------")
Debug.WriteLine("Description: {0}", CStr(mo.Properties.Item("Description").Value))
Debug.WriteLine("DeviceID: {0}", CStr(mo.Properties.Item("DeviceID").Value))
Debug.WriteLine("Name: {0}", CStr(mo.Properties.Item("Name").Value))
Debug.WriteLine("Status: {0}", CStr(mo.Properties.Item("Status").Value))
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER