資源簡介
串口通信C#實現(xiàn)(即實現(xiàn)一個簡易的串口助手),通過設(shè)置波特率實現(xiàn)波特率匹配,再選好串口,即可實現(xiàn)串口通信,完成漢字、字母、數(shù)字等的發(fā)送和接收!該程序利用C#語言編寫,簡單方便,十分實用,通過此例程可以加深對串口通信的理解!
本人課程設(shè)計作業(yè),程序均已仿真通過,放心下載!
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.IO.Ports;
namespace?SerialCommunicate
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????????System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls?=?false;
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????serialPort1.PortName?=?comboBox1.Text;
????????????????serialPort1.BaudRate?=?Convert.ToInt32(comboBox2.Text10);//十進(jìn)制數(shù)據(jù)轉(zhuǎn)換
????????????????serialPort1.Open();
????????????????button1.Enabled?=?false;//打開串口按鈕不可用
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????941??2013-07-16?12:52??串口通信C#實現(xiàn)\SerialCommunicate.sln
?????文件???????39424??2013-07-20?00:05??串口通信C#實現(xiàn)\SerialCommunicate.v11.suo
?????文件???????56320??2017-10-07?21:59??串口通信C#實現(xiàn)\SerialCommunicate.v12.suo
?????目錄???????????0??2017-12-19?16:58??串口通信C#實現(xiàn)\SerialCommunicate\
?????文件??????????77??2017-10-07?21:24??串口通信C#實現(xiàn)\SerialCommunicate\app.config
?????目錄???????????0??2017-12-19?16:58??串口通信C#實現(xiàn)\SerialCommunicate\bin\
?????目錄???????????0??2017-12-19?17:10??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\
?????文件???????15360??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\SerialCommunicate.exe
?????文件??????????77??2017-10-07?21:24??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\SerialCommunicate.exe.config
?????文件???????46592??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\SerialCommunicate.pdb
?????文件???????22656??2017-12-19?17:19??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\SerialCommunicate.vshost.exe
?????文件??????????77??2017-10-07?21:24??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\SerialCommunicate.vshost.exe.config
?????文件?????????490??2013-03-18?17:00??串口通信C#實現(xiàn)\SerialCommunicate\bin\Debug\SerialCommunicate.vshost.exe.manifest
?????文件????????5731??2017-10-07?21:59??串口通信C#實現(xiàn)\SerialCommunicate\Form1.cs
?????文件???????14315??2017-10-07?21:59??串口通信C#實現(xiàn)\SerialCommunicate\Form1.Designer.cs
?????文件????????6189??2017-10-07?21:59??串口通信C#實現(xiàn)\SerialCommunicate\Form1.resx
?????目錄???????????0??2017-12-19?16:58??串口通信C#實現(xiàn)\SerialCommunicate\obj\
?????目錄???????????0??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\
?????文件????????1567??2017-10-06?20:40??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6904??2017-12-19?17:10??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????4302??2017-12-19?17:19??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.csproj.FileListAbsolute.txt
?????文件?????????977??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.csproj.GenerateResource.Cache
?????文件????????2145??2017-10-04?20:25??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.csprojResolveAssemblyReference.cache
?????文件???????15360??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.exe
?????文件?????????180??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.Form1.resources
?????文件???????46592??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.pdb
?????文件?????????180??2017-12-19?17:11??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\SerialCommunicate.Properties.Resources.resources
?????目錄???????????0??2017-10-01?15:56??串口通信C#實現(xiàn)\SerialCommunicate\obj\Debug\TempPE\
?????文件?????????498??2013-07-16?12:52??串口通信C#實現(xiàn)\SerialCommunicate\Program.cs
?????目錄???????????0??2017-12-19?16:58??串口通信C#實現(xiàn)\SerialCommunicate\Properties\
?????文件????????1372??2013-07-16?12:52??串口通信C#實現(xiàn)\SerialCommunicate\Properties\AssemblyInfo.cs
............此處省略5個文件信息
評論
共有 條評論