Home > Net >  How to search it in GetPortName is less than the machine serial port?
How to search it in GetPortName is less than the machine serial port?

Time:01-20

I am using Microsoft website code, this machine is a notebook:
Using System. IO. Ports;
String [] ports=SerialPort. GetPortNames ();
Console. WriteLine (" the following serial ports have been found: ");
//show all serial
The foreach (string port in ports)
{
Console. WriteLine (port);
}
Console.ReadLine();

CodePudding user response:

Your notebook which to serial ports, desktop computers, notebooks are not now provide COM, even reduced to about two desktops,

CodePudding user response:

What to test code, to yourself to buy a set of usbtocom adapter, or change a desktop!

CodePudding user response:

reference 1st floor dugupiaoyun response:
your notebook which to serial ports, desktop computers, notebooks are not now provide COM, even reduced to about two desktops,

My laptop have a 15 pin serial port,
In registries can't find a serial port, however, getportnames from registries to find, I just know this
  •  Tags:  
  • C#
  • Related