Solved

VB.NET WMI Does Not Detect Virtual COM Port

Posted on 2008-06-18
2
643 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
small, multi network, problem 3 82
Recommendation vb6 to vb.net or others 14 105
Opening and Closing Connections and Data Adapters 10 42
NAS with google authentication 6 60
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now