Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VB.NET WMI Does Not Detect Virtual COM Port

Posted on 2008-06-18
2
646 Views
Last Modified: 2013-12-27
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

Open in new window

0
Comment
Question by:jigdog
2 Comments
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 21822595
So, what does the following give you?

    For Each port As String In My.Computer.Ports.SerialPortNames
        debug.writeline(port)
    Next
0
 

Author Closing Comment

by:jigdog
ID: 31468659
Don't I feel like an idiot.  Still getting used to the convenient new methods and props in .net.  thanks!!
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
When posting a question about a Cisco ASA, Cisco Router or Cisco Switch, it can aid diagnosis if a suitably sanitised copy of the config is provided. It is much better to leave as much of the configuration as original as possible, as it could be tha…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question