Wednesday, 15 July 2015

c# - SerialPort.GetPortNames() -



c# - SerialPort.GetPortNames() -

i doing quick test come com ports. run next code on pc adds com1 combo box? pc has 6 usb ports, why finding 1?

string[] ports = serialport.getportnames(); foreach (string port in ports) { combobox1.items.add(port); }

even if had hundred of them, serialport class used command serial port resources, , usb not serial port.

there multiple libraries allow programme usb ports, trying achieve?

check out libusbdotnet c# usb library

http://sourceforge.net/projects/libusbdotnet/

if want enumerate available usb ports, can quering wmi, see reply more details on how that: get list of connected usb devices

c# usb

No comments:

Post a Comment