Hello,

I have used the following code to list my serial ports on my computer, but i am receiving the abnormal portnames as my attachment. The portnames should be as following text:

Com3
52
8
11
38
6
13
53
4

My code:

Dim ports As String() = IO.Ports.SerialPort.GetPortNames()

For Each port In ports
            portlar.Items.Add(port)
        Next port
Member Avatar for Dukane
For Each port As String In My.Computer.Ports.SerialPortNames
     cboPort.Items.Add(port)
Next

That's what I use to add my ports into a combo box and it works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.