Anyone here has an idea where I can get the ports name listed in my PC?
By using this code:
For i As Integer = 0 To My.Computer.Ports.SerialPortNames.Count - 1
cmbPort.Properties.Items.Add(My.Computer.Ports.SerialPortNames(i))
Next
I could get COM26
and etc. if any, but that's not what I want. Instead of retrieving COM26
, I want USB-SERIAL CH340
or USB-SERIAL CH340 (COM26)
. How could I do that?
That isn't the name of the serial port; it is COM26. The name listed in the device manager is probably the name of the device providing the emulation.
Why do you want that name? If you describe your problem more completely, figuring out the solution will be easier.
You could use WMI... Add Reference to System.Management in your application then,
shown on StackOverflow: Getting Serial Port Information
I got mixed results from other answers. I've come up with this code working better for me.
Add Reference to System.Management in your application
Try this .
That should work..