文件名称:C#WinForm串口调试工具源码2012825
文件大小:116KB
文件格式:RAR
更新时间:2015-09-15 07:01:40
串口 调试 工具 源码
C#WinForm串口调试工具源码 功能介绍: 运行本程序,在“发送数据”文本框中输入要传送的数据, 单击【发送】按钮,将传送的数据发送到所选择 的端口号中 主要代码: private void btnOpenPort_Click(object sender, EventArgs e) { if (!openState) { openState = true;//已经打开 btnOpenPort.Text = "关闭串口"; this.pictureBox.Image = global::SerialDemo.Properties.Resources.btnOk2; strPortName = cmbPort.Text; strBaudRate = cmbBaudRate.Text; strDataBits = cmbDataBits.Text; strStopBits = cmbStopBit.Text; sp.PortName = strPortName; sp.BaudRate = int.Parse(strBaudRate); sp.DataBits = int.Parse(strDataBits); sp.StopBits = (StopBits)int.Parse(strStopBits); sp.ReadTimeout = 500; //打开 sp.Open(); sp.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived); } else { openState = false; btnOpenPort.Text = "打开串口"; this.pictureBox.Image = global::SerialDemo.Properties.Resources.can1; sp.DataReceived -= new SerialDataReceivedEventHandler(sp_DataReceived); sp.Close(); } }
【文件预览】:
51aspx_ACCESSPort1d62356a-a6c3-4f0b-8b0f-59be496eb406
----ComSet.cs(2KB)
----Program.cs(474B)
----SerialDemo.csproj(4KB)
----obj()
--------SerialDemo.csproj.FileListAbsolute.txt(621B)
--------Debug()
--------SerialDemo.csproj.FileList.txt(333B)
----bin()
--------Debug()
----Resources()
--------can1.png(3KB)
--------btnOk2.png(5KB)
----SerialDemo.sln(909B)
----SerialForm.resx(20KB)
----ComSet.Designer.cs(8KB)
----SerialForm.Designer.cs(17KB)
----ComSet.resx(6KB)
----Properties()
--------AssemblyInfo.cs(1KB)
--------Settings.Designer.cs(1KB)
--------Resources.resx(6KB)
--------Settings.settings(249B)
--------Resources.Designer.cs(3KB)
----SerialForm.cs(5KB)