How to find which serial port is currently used in c#?

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-05-30T11:40:41Z Indexed on 2010/05/30 11:42 UTC
Read the original article Hit count: 331

Filed under:
|
|

I ve connected my mobile phone to my PC and used this,

string[] lPorts = System.IO.Ports.SerialPort.GetPortNames();

and the result was an array of port names

"COM4"
"COM3"
"COM1"
"COM7"
"COM6"

Now,How to find which serial port is currently used/to which port my mobile phone is connected in c#?

© Stack Overflow or respective owner

Related posts about c#

Related posts about detection