資源簡介
利用串口通訊進(jìn)行bin文件升級,支持不同波特率。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.IO;
using?System.IO.Ports;
using?System.Linq;
using?System.Text;
using?System.Threading;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?IAP
{
????public?partial?class?Form1?:?Form
????{
????????SerialPort?myport?=?new?SerialPort();
????????string?filename?=?null;
?
????????static?byte[]?download?=?{?0x44?0x4F?0x57?0x4E?0x4C?0x4F?0x41?0x44?0x0D?};
????????public?Form1()
????????{
????????????InitializeComponent();
????????????Control.CheckForIllegalCrossThreadCalls?=?false;
????????????myport.DataReceived?+=?Port_DataReceived;
????????????string[]?ports?=?SerialPort.GetPortNames();//獲取當(dāng)前計算機的串行端口名稱數(shù)組??ports?=?{COM1COM2.....}
????????????if?(ports?==?null?||?ports.Length?<=?0)
????????????{
????????????????comboBox_port.Items.Add(“無端口“);
????????????}
????????????else
????????????{
???????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????766??2018-08-03?11:23??IAP\IAP\animal01.ico
?????文件????????187??2018-08-02?10:04??IAP\IAP\App.config
?????文件??????16384??2018-08-03?11:52??IAP\IAP\bin\Debug\IAP.exe
?????文件????????187??2018-08-02?10:04??IAP\IAP\bin\Debug\IAP.exe.config
?????文件??????32256??2018-08-03?11:52??IAP\IAP\bin\Debug\IAP.pdb
?????文件??????24224??2018-08-03?11:52??IAP\IAP\bin\Debug\IAP.vshost.exe
?????文件????????187??2018-08-02?10:04??IAP\IAP\bin\Debug\IAP.vshost.exe.config
?????文件??????15872??2018-08-03?11:51??IAP\IAP\bin\Release\IAP.exe
?????文件????????187??2018-08-02?10:04??IAP\IAP\bin\Release\IAP.exe.config
?????文件??????30208??2018-08-03?11:51??IAP\IAP\bin\Release\IAP.pdb
?????文件??????24224??2018-08-03?11:51??IAP\IAP\bin\Release\IAP.vshost.exe
?????文件????????187??2018-08-02?10:04??IAP\IAP\bin\Release\IAP.vshost.exe.config
?????文件????????490??2016-07-16?19:44??IAP\IAP\bin\Release\IAP.vshost.exe.manifest
?????文件???????7159??2018-08-03?11:51??IAP\IAP\Form1.cs
?????文件??????11472??2018-08-03?11:48??IAP\IAP\Form1.Designer.cs
?????文件???????5817??2018-08-03?11:48??IAP\IAP\Form1.resx
?????文件???????3949??2018-08-03?11:23??IAP\IAP\IAP.csproj
?????文件???????1453??2018-08-02?10:16??IAP\IAP\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7166??2018-08-03?11:23??IAP\IAP\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????897??2018-08-03?11:52??IAP\IAP\obj\Debug\IAP.csproj.FileListAbsolute.txt
?????文件????????977??2018-08-03?11:52??IAP\IAP\obj\Debug\IAP.csproj.GenerateResource.Cache
?????文件???????2211??2018-08-02?10:45??IAP\IAP\obj\Debug\IAP.csprojResolveAssemblyReference.cache
?????文件??????16384??2018-08-03?11:52??IAP\IAP\obj\Debug\IAP.exe
?????文件????????180??2018-08-03?11:52??IAP\IAP\obj\Debug\IAP.Form1.resources
?????文件??????32256??2018-08-03?11:52??IAP\IAP\obj\Debug\IAP.pdb
?????文件????????180??2018-08-03?11:23??IAP\IAP\obj\Debug\IAP.Properties.Resources.resources
?????文件??????????0??2018-08-02?10:04??IAP\IAP\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2018-08-02?10:04??IAP\IAP\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2018-08-02?10:04??IAP\IAP\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????7170??2018-08-03?11:45??IAP\IAP\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache
............此處省略31個文件信息
評論
共有 條評論