C# serialPort 串口 获取扫描抢数据
来源:互联网 发布:网络出版社 编辑:程序博客网 时间:2024/04/29 13:06
private void SetServer_Load(object sender, EventArgs e)
{
comport.BaudRate = 9600;
comport.DataBits = 8;
comport.StopBits = (StopBits)Enum.Parse(typeof(StopBits), "One");
comport.Parity = (Parity)Enum.Parse(typeof(Parity), "None");
comport.Encoding = Encoding.GetEncoding("GBK");
comport.PortName = "COM1";
comport.Open();
comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
}
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
try
{
data = comport.ReadExisting();
this.textBox1.Invoke(new EventHandler(delegate
{
this.textBox1.Text =this.textBox1.Text+ data;
}));
//this.textBox1.Text = data;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
- C# serialPort 串口 获取扫描抢数据
- C#串口serialPort操作
- C# SerialPort 串口通信
- C#串口serialPort操作
- C# SerialPort 串口通信
- C#串口serialPort操作
- C#串口serialPort操作
- C# SerialPort 串口读写
- C# SerialPort串口通信发送接收,处理接收数据完整
- c# SerialPort控件串口通信
- C# SerialPort控件串口通信
- c# SerialPort控件串口通信
- C#操作串口serialPort实例
- c# SerialPort控件串口通信
- c#实现串口操作 SerialPort
- C# 串口通讯:serialport类
- 传感器(c#2.0)serialPort串口通讯
- c# SerialPort控件串口通信 收藏
- 好软件推荐:虚拟串口,virtual serial port,virtual com,com0com,用不着serialnull(全是关
- Java关键字final、static使用总结
- Tapestry5.3使用总结
- 深入浅出C/C++中的正则表达式库
- 模拟Http协议
- C# serialPort 串口 获取扫描抢数据
- JS动态添加option和删除option
- 【转载】图像处理、模式识别、模式分类、机器视觉推荐图书
- CentOS 5.5 安装 MONO 2.10.6
- 在ubuntu_linux下安装eclipse以及运行c++程序的安装步骤
- 20130717_抽象类设计的几条原则
- poj 2828 Buy Tickets(线段树)
- JSP 9 大内置对象详解
- CXF之动态客户端实例