Solved

VB.NET WMI Does Not Detect Virtual COM Port

Posted on 2008-06-18
2
650 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
[X]
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
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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