Our group began to try to add a virtual serial port with com0com, but encountered a problem, the system can see the added virtual serial port, but in C # cannot get the serial port. After many attempts, we decided to switch to virtual Serial port driver to add a dummy serial port.
(Tool Link: https://pan.baidu.com/s/1hs1mDE0 Password: fsq1)
How to use :
Click Add pair to add COM port pairs
After adding:
Then in Computer Management-Device Manager, you can see the newly added virtual COM ports:
C # Get serial code :
Private string[] Ports=system.io.ports.serialport.getportnames ();
This group uses the SerialPort control in Windows apps, enabling the function 1 to scan the system COM port, allowing the user to select COM port and baud rate
(See http://www.cnblogs.com/shenbing/p/6323152.htm L and http://blog.csdn.net/ZHINENGABC123456/for detailed use of SerialPort controls.) article/details/70145341 Two blog post
The specific results are as follows:
After this user operation, save the user's last selected COM port and bit rate through the INI file.
INI file contents:
[PORT] name=com1[baudrate]name=9600
Implementation of Windows system add virtual serial port and Cantoolapp function 1