91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 591KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-17
  • 語言: 其他
  • 標簽:

資源簡介

modubs實現對各種的智能設備的調試,比如溫度,濕度,開關,02D,03D,04D參數

資源截圖

代碼片段和文件信息


using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.IO.Ports;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Windows.Controls;
using?System.Threading;
using?System.Windows.Documents;




namespace?BXHSerialPort
{
????public?partial?class?frmSerialPort?:?Form
????{
????????private?SerialPort?ComDevice?=?new?SerialPort();
????????public?frmSerialPort()
????????{
????????????InitializeComponent();
????????????this.init();
????????}
????????public?void?init()
????????{
????????????btnSend.Enabled?=?false;
????????????cbbComList.Items.AddRange(SerialPort.GetPortNames());
????????????if?(cbbComList.Items.Count?>?0)
????????????{
????????????????cbbComList.SelectedIndex?=?0;
????????????}
????????????cbbBaudRate.SelectedIndex?=?5;
????????????//cbbBaudRate[5]=?System.Drawing.Color.Red;
????????????cbbDataBits.SelectedIndex?=?0;
????????????cbbParity.SelectedIndex?=?0;
????????????cbbStopBits.SelectedIndex?=?0;
????????????pictureBox1.BackgroundImage?=?Properties.Resources.red;

????????????ComDevice.DataReceived?+=?new?SerialDataReceivedEventHandler(Com_DataReceived);//綁定事件
????????????panel3.Visible?=?false;
????????}

????????///?
????????///?打開串口
????????///?

????????///?
????????///?
????????///?在沒有打開設備后,不顯示所有的控件,1不能點擊,2不會出現
????????private?void?btnOpen_Click(object?sender?EventArgs?e)
????????{
????????????panel3.Visible?=?true;
????????????if?(cbbComList.Items.Count?<=?0)
????????????{
????????????????MessageBox.Show(“沒有發現串口請檢查線路!“);
????????????????return;
????????????}

????????????if?(ComDevice.IsOpen?==?false)
????????????{
????????????????ComDevice.PortName?=?cbbComList.SelectedItem.ToString();
????????????????ComDevice.BaudRate?=?Convert.ToInt32(cbbBaudRate.SelectedItem.ToString());
????????????????ComDevice.Parity?=?(Parity)Convert.ToInt32(cbbParity.SelectedIndex.ToString());
????????????????ComDevice.DataBits?=?Convert.ToInt32(cbbDataBits.SelectedItem.ToString());
????????????????ComDevice.StopBits?=?(StopBits)Convert.ToInt32(cbbStopBits.SelectedItem.ToString());
????????????????try
????????????????{
????????????????????ComDevice.Open();
????????????????????btnSend.Enabled?=?true;
????????????????}
????????????????catch?(Exception?ex)
????????????????{
????????????????????MessageBox.Show(ex.Message?“錯誤“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????????return;
????????????????}
????????????????btnOpen.Text?=?“關閉串口“;
????????????????pictureBox1.BackgroundImage?=?Properties.Resources.green;
????????????}
????????????else
????????????{
????????????????try
????????????????{
????????????????????ComDevice.Close();
????????????????????btnSend.Enabled?=?false;
????????????????}
????????????????catch?(Exception?ex)
????????????????{
????????????????????MessageB

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-26?18:00??BenXH\
?????目錄???????????0??2018-03-30?10:01??BenXH\BXHSerialPort\
?????文件????????4234??2018-03-30?10:19??BenXH\BXHSerialPort\BXHSerialPort.csproj
?????文件?????????504??2018-03-30?14:55??BenXH\BXHSerialPort\Program.cs
?????目錄???????????0??2018-03-26?18:00??BenXH\BXHSerialPort\Properties\
?????文件????????1368??2017-03-25?14:05??BenXH\BXHSerialPort\Properties\AssemblyInfo.cs
?????文件????????3598??2017-03-25?15:22??BenXH\BXHSerialPort\Properties\Resources.Designer.cs
?????文件????????6433??2017-03-25?15:22??BenXH\BXHSerialPort\Properties\Resources.resx
?????文件????????1100??2017-03-25?14:05??BenXH\BXHSerialPort\Properties\Settings.Designer.cs
?????文件?????????249??2017-03-25?14:05??BenXH\BXHSerialPort\Properties\Settings.settings
?????目錄???????????0??2018-03-26?18:00??BenXH\BXHSerialPort\Resources\
?????文件????????3115??2017-03-25?14:51??BenXH\BXHSerialPort\Resources\green.png
?????文件????????3131??2017-03-25?15:22??BenXH\BXHSerialPort\Resources\red.png
?????文件????????5647??2018-03-30?16:34??BenXH\BXHSerialPort\RingBufferManager.cs
?????目錄???????????0??2017-03-25?20:11??BenXH\BXHSerialPort\bin\
?????目錄???????????0??2018-04-02?17:22??BenXH\BXHSerialPort\bin\Debug\
?????文件????????4748??2018-04-02?17:22??BenXH\BXHSerialPort\bin\Debug\BXHSerialPort.xml
?????文件??????358912??2018-04-02?17:22??BenXH\BXHSerialPort\bin\Debug\BXHSerialPort.exe
?????文件??????790016??2018-04-02?17:22??BenXH\BXHSerialPort\bin\Debug\BXHSerialPort.pdb
?????文件???????22472??2018-04-03?18:30??BenXH\BXHSerialPort\bin\Debug\BXHSerialPort.vshost.exe
?????文件?????????490??2010-03-17?22:39??BenXH\BXHSerialPort\bin\Debug\BXHSerialPort.vshost.exe.manifest
?????文件???????33973??2017-03-25?19:56??BenXH\運行截圖\run.png
?????文件??????359987??2018-04-02?16:59??BenXH\BXHSerialPort\frmSerialPort.Designer.cs
?????文件?????1240033??2018-04-02?17:22??BenXH\BXHSerialPort\frmSerialPort.cs
?????文件????????5817??2018-04-02?16:59??BenXH\BXHSerialPort\frmSerialPort.resx
?????目錄???????????0??2017-03-25?20:11??BenXH\BXHSerialPort\obj\
?????目錄???????????0??2018-04-02?17:22??BenXH\BXHSerialPort\obj\Debug\
?????文件????????6745??2018-03-30?10:19??BenXH\BXHSerialPort\obj\Debug\BXHSerialPort.Properties.Resources.resources
?????文件????????6551??2018-04-03?18:30??BenXH\BXHSerialPort\obj\Debug\BXHSerialPort.csproj.FileListAbsolute.txt
?????文件????????1059??2018-04-02?17:01??BenXH\BXHSerialPort\obj\Debug\BXHSerialPort.csproj.GenerateResource.Cache
?????文件????????2365??2018-03-21?11:32??BenXH\BXHSerialPort\obj\Debug\BXHSerialPort.csprojResolveAssemblyReference.cache
............此處省略17個文件信息

評論

共有 條評論

相關資源