C# Identify the Available Serial Port on the PC

C# Identify the Available Serial Port on the PC

with this sample code you can identify the available serial port on the PC, running a ForEach iteration SerialPortNames property vb.net and GetPortNames method c#.

Sample code C#.

private void BtnFindSerialPort_Click(object sender, EventArgs e) 

     foreach (string ports in System.IO.Ports.SerialPort.GetPortNames()) 
     { 
         MessageBox.Show("Serial port avialible" + " " + ports); 
     } 
}
Leave a Comment
  • Please add 5 and 1 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Richard Mueller edited Revision 1. Comment: Removed (en-US) from title, modified title casing

Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Richard Mueller edited Revision 1. Comment: Removed (en-US) from title, modified title casing

Page 1 of 1 (1 items)