0

Instead hard coding the port name, how can i make my program find the correct COM port? I don't want to be given the option of which COM port to chose. I want my program to directly Open it.

public string portName = "COM5";
Shayan Riyaz
  • 82
  • 11
  • take a look at this question https://stackoverflow.com/q/1081871/10859114 – Alirezaarabi Apr 13 '20 at 23:52
  • This post may be helpful [https://stackoverflow.com/questions/24850367/c-sharp-how-to-detect-serial-port-programatically](https://stackoverflow.com/questions/24850367/c-sharp-how-to-detect-serial-port-programatically) –  Apr 13 '20 at 23:53
  • These solutions were not of help in my case. I am trying to use the file for a Unity based project – Shayan Riyaz Apr 14 '20 at 03:34

0 Answers0