![](https://csdnimg.cn/release/download_crawler_static/87021647/bg1.jpg)
(完整版)自己用 C 写的一个定时接收的串口调试软件,所有代码
以下为所有的原代码:
using System;
using System。Collections.Generic;
using System。ComponentModel;
using System.Data;
using System.Drawing;
using System。Linq;
using System。Text;
using System。Threading; //添线程引用
using System.IO。Ports; //添加串口端口引用
using System。Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Control。CheckForIllegalCrossThreadCalls = false; //处理线程错误问题
// string[] PortName = System.IO。Ports.SerialPort。GetPortNames(); // 获取串口名字
string[] PortName = SerialPort.GetPortNames(); // 获取串口名字 using System。IO.Ports; 添