資源簡介
設定連續讀取時間后,從COM口獲取超聲波傳感器傳來的數據,并把數據寫入文本文件,以便3后續分析使用
代碼片段和文件信息
using?System;??
?using?System.Collections.Generic;??
?using?System.ComponentModel;??
?using?System.Data;??
?using?System.Drawing;??
?using?System.Text;??
?using?System.Windows.Forms;??
?using?System.IO.Ports;??
?using?System.Threading;
using?System.IO;
namespace?CommTest2
{
????
????public?partial?class?Form1?:?Form
????{
????SerialPort?MSComm1?=?new?SerialPort();
????string?GetTxt?=?““;
????Int32??rTextNum???=?0;
????Int32?SendCount?=?0;
????Int32?GetCount??=?0;
????Int32?ErrCount??=?0;
????Int32?SendLen??=?0;
????Int32?SendTime??=?0;
????Int32?Allsum?=?0;
????Int32?CloseCount?=?0;
????Byte[]?arr_command?=?new?Byte[0];
????Queue??QU??=?new?Queue(480);
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.?????29184??2018-12-10?13:42??超聲波串口連續接收\.vs\CommTest3\v15\.suo
?????文件??????????0??2018-12-10?10:58??超聲波串口連續接收\.vs\CommTest3\v15\Server\sqlite3\db.lock
?????文件?????561152??2018-12-10?13:42??超聲波串口連續接收\.vs\CommTest3\v15\Server\sqlite3\storage.ide
?????文件????????144??2013-09-09?20:18??超聲波串口連續接收\CommTest3\app.config
?????文件??????39936??2018-12-10?10:59??超聲波串口連續接收\CommTest3\bin\Debug\CommTest2.exe
?????文件????????144??2013-09-09?20:18??超聲波串口連續接收\CommTest3\bin\Debug\CommTest2.exe.config
?????文件??????30208??2018-12-10?10:59??超聲波串口連續接收\CommTest3\bin\Debug\CommTest2.pdb
?????文件??????11600??2017-09-20?15:54??超聲波串口連續接收\CommTest3\bin\Debug\CommTest2.vshost.exe
?????文件????????144??2013-09-09?20:18??超聲波串口連續接收\CommTest3\bin\Debug\CommTest2.vshost.exe.config
?????文件????????490??2016-07-16?19:44??超聲波串口連續接收\CommTest3\bin\Debug\CommTest2.vshost.exe.manifest
?????文件??????47694??2017-08-21?09:56??超聲波串口連續接收\CommTest3\bin\Debug\Debug.rar
?????文件???????8306??2018-12-10?12:53??超聲波串口連續接收\CommTest3\bin\Debug\LOG\-4.7°.txt
?????文件???????8466??2018-12-10?12:48??超聲波串口連續接收\CommTest3\bin\Debug\LOG\0°.txt
?????文件???????8426??2018-12-10?12:52??超聲波串口連續接收\CommTest3\bin\Debug\LOG\10°.txt
?????文件???????8330??2018-12-11?15:58??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_11155837.txt
?????文件???????8386??2018-12-11?15:59??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_11155957.txt
?????文件???????8386??2018-12-11?16:00??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_1116056.txt
?????文件???????8370??2018-12-11?16:10??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_1116100.txt
?????文件???????8402??2018-12-11?16:02??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_111627.txt
?????文件???????8314??2018-12-11?16:04??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_1116457.txt
?????文件???????8338??2018-12-11?16:05??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_1116557.txt
?????文件???????8282??2018-12-11?16:07??超聲波串口連續接收\CommTest3\bin\Debug\LOG\12_1116722.txt
?????文件???????8378??2018-12-10?12:49??超聲波串口連續接收\CommTest3\bin\Debug\LOG\2.5°.txt
?????文件???????8338??2018-12-10?12:50??超聲波串口連續接收\CommTest3\bin\Debug\LOG\5°.txt
?????文件???????8442??2018-12-10?12:51??超聲波串口連續接收\CommTest3\bin\Debug\LOG\7.5°.txt
?????文件??????53248??2006-01-14?10:24??超聲波串口連續接收\CommTest3\bin\Debug\XPanderControl.dll
?????文件???????3691??2013-09-09?20:18??超聲波串口連續接收\CommTest3\CommTest3.csproj
?????文件??????11014??2017-08-18?15:18??超聲波串口連續接收\CommTest3\Form1.cs
?????文件??????25428??2017-08-18?14:53??超聲波串口連續接收\CommTest3\Form1.Designer.cs
?????文件??????32767??2017-08-18?14:53??超聲波串口連續接收\CommTest3\Form1.resx
............此處省略43個文件信息
- 上一篇:TCP文件傳輸簡例
- 下一篇:基于C#的倒計時小程序
評論
共有 條評論