SerialPort Info
-
Hi, i'm Trying to Retrieve the serial com Info using this code:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort"); foreach(ManagementObject Port in searcher.Get()) { string a = (string) Port.GetPropertyValue("Name"); }
The Thins is that it only get's the first COM info i have COM1 and USB Serial COM2 but i could not get the USB Serial COM2 info ANYONE, THANKS :)Have Fun Never forget it
-
Hi, i'm Trying to Retrieve the serial com Info using this code:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort"); foreach(ManagementObject Port in searcher.Get()) { string a = (string) Port.GetPropertyValue("Name"); }
The Thins is that it only get's the first COM info i have COM1 and USB Serial COM2 but i could not get the USB Serial COM2 info ANYONE, THANKS :)Have Fun Never forget it
If it is just the list of serial ports in your system you want, just use the static function:
string [] allComPorts = SerialPort.GetPortNames ();
It will return hardware and virtual ports. -
If it is just the list of serial ports in your system you want, just use the static function:
string [] allComPorts = SerialPort.GetPortNames ();
It will return hardware and virtual ports.