xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

在上位機開發中,時常會引入輸入信號作為啟動信號,此Demo完美解決使用腳踏開關作輸入信號的問題

資源截圖

代碼片段和文件信息

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.Threading.Tasks;
using?System.Windows.Forms;

namespace?RTS
{
????public?partial?class?Form1?:?Form
????{
????????//將ComDevice.RtsEnable置為True,表示啟用發送請求(RST)信號,將請求發送/可以發送?(RTS/CTS)[第7和第8針腳]硬件握手時[腳踏短接],會觸發ComDevice.PinChanged事件及ComDevice.CtsHolding的Bool值變化。

????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????SerialPort?sp?=?new?SerialPort();
????????
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????sp.RtsEnable=true;
????????????cmb_JtCom.Items.AddRange(SerialPort.GetPortNames());
????????????//sp.DataReceived?+=?new?SerialDataReceivedEventHandler(sp_DataReceived)?;
????????????sp.PinChanged?+=?new?SerialPinChangedEventHandler(sp_DataReceived);
????????}



????????private?void?btn_Open_Click(object?sender?EventArgs?e)
????????{
????????????if(cmb_JtCom.Items.Count<=0)
????????????{
????????????????MessageBox.Show(“沒有發現串口,請重試“);
????????????????return;
????????????????
????????????}
????????????if?(sp.IsOpen==false)
????????????{
????????????????sp.PortName?=?cmb_JtCom.SelectedItem.ToString();
????????????????sp.BaudRate?=?9600;
????????????????sp.DataBits?=?8;
????????????????sp.StopBits?=?StopBits.One;
????????????????sp.Parity?=?Parity.None;
????????????????try
????????????????{
????????????????????sp.Open();
????????????????????timer1.Enabled?=?true;
????????????????????
????????????????}
????????????????catch(Exception?ex)
????????????????{
????????????????????MessageBox.Show(ex.Message?“錯誤“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????}
????????????????btn_Open.Text?=?“關閉串口“;
????????????}
????????????else
????????????{
????????????????try
????????????????{
????????????????????sp.Close();
????????????????????timer1.Enabled?=?false;
????????????????}
????????????????catch?(Exception?ex)
????????????????{
????????????????????MessageBox.Show(ex.Message?“錯誤“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????}
????????????????btn_Open.Text?=?“打開串口“;
????????????}
????????????cmb_JtCom.Enabled?=?!sp.IsOpen;
????????}
????????bool?b;
????????void?sp_DataReceived(object?sender?SerialPinChangedEventArgs?e)
????????{
????????????MessageBox.Show(“RTS觸發成功“);
??????????
????????}

????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????label1.Text?=?sp.CtsHolding.ToString();
????????????
????????}

????????



????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????187??2018-03-15?10:40??RTS\RTS\App.config

?????文件??????10240??2018-03-20?17:12??RTS\RTS\bin\Debug\RTS.exe

?????文件????????187??2018-03-15?10:40??RTS\RTS\bin\Debug\RTS.exe.config

?????文件??????24064??2018-03-20?17:12??RTS\RTS\bin\Debug\RTS.pdb

?????文件??????24224??2018-03-20?17:11??RTS\RTS\bin\Debug\RTS.vshost.exe

?????文件????????187??2018-03-15?10:40??RTS\RTS\bin\Debug\RTS.vshost.exe.config

?????文件????????490??2013-03-18?17:00??RTS\RTS\bin\Debug\RTS.vshost.exe.manifest

?????文件???????2824??2018-03-20?17:12??RTS\RTS\Form1.cs

?????文件???????3503??2018-03-15?13:25??RTS\RTS\Form1.Designer.cs

?????文件???????6011??2018-03-15?13:25??RTS\RTS\Form1.resx

?????文件????????865??2018-03-15?10:40??RTS\RTS\obj\Debug\DesignTimeResolveAssemblyReferences.cache

?????文件???????6959??2018-03-15?10:44??RTS\RTS\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件????????627??2018-03-20?17:11??RTS\RTS\obj\Debug\RTS.csproj.FileListAbsolute.txt

?????文件????????977??2018-03-15?13:25??RTS\RTS\obj\Debug\RTS.csproj.GenerateResource.Cache

?????文件???????2211??2018-03-15?11:12??RTS\RTS\obj\Debug\RTS.csprojResolveAssemblyReference.cache

?????文件??????10240??2018-03-20?17:12??RTS\RTS\obj\Debug\RTS.exe

?????文件????????180??2018-03-15?13:25??RTS\RTS\obj\Debug\RTS.Form1.resources

?????文件??????24064??2018-03-20?17:12??RTS\RTS\obj\Debug\RTS.pdb

?????文件????????180??2018-03-15?11:12??RTS\RTS\obj\Debug\RTS.Properties.Resources.resources

?????文件??????????0??2018-03-15?10:40??RTS\RTS\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

?????文件??????????0??2018-03-15?10:40??RTS\RTS\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

?????文件??????????0??2018-03-15?10:40??RTS\RTS\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

?????文件????????515??2018-03-15?10:40??RTS\RTS\Program.cs

?????文件???????1348??2018-03-15?10:40??RTS\RTS\Properties\AssemblyInfo.cs

?????文件???????2858??2018-03-15?10:40??RTS\RTS\Properties\Resources.Designer.cs

?????文件???????5612??2018-03-15?10:40??RTS\RTS\Properties\Resources.resx

?????文件???????1090??2018-03-15?10:40??RTS\RTS\Properties\Settings.Designer.cs

?????文件????????249??2018-03-15?10:40??RTS\RTS\Properties\Settings.settings

?????文件???????3786??2018-03-15?11:12??RTS\RTS\RTS.csproj

?????文件????????978??2018-03-15?10:40??RTS\RTS.sln

............此處省略12個文件信息

評論

共有 條評論