資源簡介
對COM發送指令并返回數據
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.IO.Ports;
using?System.Linq;
using?System.Text;
using?System.Threading;
using?System.Threading.Tasks;
namespace?SerialPortReceiveData
{
????class?Program
????{
????????static?void?Main(string[]?args)
????????{
????????????float?f1?=?-0.970000f;
????????????float?f2?=?-0.130000f;
????????????Console.Write(f1);
????????????Console.Write(‘=‘);
????????????byte[]?b1?=?BitConverter.GetBytes(f1);
????????????ConsoleBytes(b1);
????????????Console.WriteLine();
????????????Console.Write(f2);
????????????Console.Write(‘=‘);
????????????byte[]?b2?=?BitConverter.GetBytes(f2);
????????????ConsoleBytes(b2);
????????????Console.WriteLine();
????????????byte[]?byteFloat?=?{?0x02??0x03??0x04??0xff??0xc3??0x00??0x00??0x09??0x1b?};
????????????float?fd?=?BitConverter.ToSingle(byteFloat?0);
????????????ConsoleBytes(byteFloat);
????????????Console.Write(‘=‘);
????????????Console.WriteLine(fd);
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1362??2019-07-08?17:07??Properties\AssemblyInfo.cs
?????文件????????189??2019-07-08?17:07??App.config
?????文件???????4350??2019-07-12?13:50??Program.cs
?????文件???????2585??2019-07-08?17:07??SerialPortReceiveData.csproj
?????文件????????288??2019-07-12?10:50??SerialPortReceiveData.csproj.user
?????目錄??????????0??2019-07-08?17:07??Properties
-----------?---------??----------?-----??----
?????????????????8774????????????????????6
- 上一篇:Windows7WIFI熱點設置器
- 下一篇:C# 環境變量設置
評論
共有 條評論