資源簡介
(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序,包含所有原創源程序,可直接用

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Collections;
using?System.IO.Ports;
using?System.Diagnostics;
using?System.Timers;
using?System.Drawing;
namespace?port_51
{
????public?partial?class?Form1?:?Form
????{
????????SerialPort?sp1?=?new?SerialPort();
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????int?timer_t?=?0;
????????
????????#region??窗體載入
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????//皮膚文件
????????????skinEngine1.SkinFile?=?Application.StartupPath?+?@“\DiamondBlue.ssk“;
????????????skinEngine1.SkinFile?=?Application.StartupPath?+?@“\DiamondBlue.ssk“;
????????????//系統時間
????????????timer2.Start();
????????????//所有串口
????????????pictureBox1.Image?=?Properties.Resources.gray;
????????????for?(int?i?=?1;?i?<=?16;?i++)
????????????{
????????????????cb_port.Items.Add(“COM“+i);
????????????????cb_port.SelectedIndex?=?0;
????????????}
????????????//波特率
????????????int[]?baud?=?{?115200?57600?38400?28800?19200?14400?9600?4800?2400?1200?};
????????????for?(int?i?=?0;?i?10;?i++)
????????????{
????????????????cb_baud.Items.Add(baud[i]);
????????????}
????????????cb_baud.SelectedIndex?=?7;
????????????//校驗位
????????????????cb_check.Items.Add(“None“);
????????????????cb_check.Items.Add(“Odd“);
????????????????cb_check.Items.Add(“Even“);
????????????????cb_check.Items.Add(“Mark“);
????????????????cb_check.Items.Add(“Space“);
????????????????cb_check.SelectedIndex?=?0;
????????????//數據位
????????????for?(int?i?=?8;?i?>?3;?i--)
????????????{
????????????????cb_data.Items.Add(i);
????????????}
????????????cb_data.SelectedIndex?=?0;
????????????//停止位
????????????cb_stop.Items.Add(“1“);
????????????cb_stop.Items.Add(“1.5“);
????????????cb_stop.Items.Add(“2“);
????????????cb_stop.SelectedIndex?=?0;
????????????//發送/接收格式默認
????????????rb_hex_r.Checked?=?true;
????????????rb_hex_s.Checked?=?true;
????????????timer1.Enabled?=?false;
????????
????????????
????????}
????????#endregion
????????#region?系統時間
????????private?void?timer2_Tick(object?sender?EventArgs?e)
????????{
????????????DateTime?dt?=?System.DateTime.Now;
????????????label8.Text?=?dt.ToString();
????????}
????????#endregion
???????
????????#region??“文件”操作
????????private?void?label7_MouseEnter(object?sender?EventArgs?e)
????????{
????????????label7.BackColor?=?Color.LightGray;
????????}
????????private?void?label7_MouseLeave(object?sender?EventArgs?e)
????????{
????????????label7.BackColor?=?Color.Transparent;
????????}
????????#endregion
????????#region??全部串口和可用串口切換
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????switch?(button1.Text)
????????????{
????????????????case?“可用串口“:
????????????????????try
?????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-10-12?12:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\
?????目錄???????????0??2015-10-12?12:17??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\
?????文件???????39243??2015-10-10?10:30??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Form1.Designer.cs
?????文件???????24144??2015-10-12?10:26??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Form1.cs
?????文件???????10774??2015-10-10?10:30??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Form1.resx
?????文件??????581632??2010-11-10?15:00??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\IrisSkin4.dll
?????文件?????????499??2015-10-01?10:20??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Program.cs
?????目錄???????????0??2015-10-12?12:17??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Properties\
?????文件????????1436??2015-10-01?10:20??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Properties\AssemblyInfo.cs
?????文件????????3582??2015-10-10?10:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Properties\Resources.Designer.cs
?????文件????????6671??2015-10-01?15:31??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Properties\Resources.resx
?????文件????????1089??2015-10-10?10:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Properties\Settings.Designer.cs
?????文件?????????249??2015-10-01?10:20??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Properties\Settings.settings
?????目錄???????????0??2015-10-12?12:17??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Resources\
?????文件????????3221??2015-10-01?15:42??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Resources\gray.png
?????文件????????3208??2015-10-01?15:42??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Resources\green.png
?????文件????????3068??2015-10-01?15:42??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\Resources\red.png
?????文件?????????144??2015-10-10?10:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\app.config
?????目錄???????????0??2015-10-12?12:17??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\
?????目錄???????????0??2015-10-12?12:17??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\
?????文件???????16021??2006-03-22?12:25??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\DiamondBlue.ssk
?????文件???????16669??2006-03-22?12:26??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\DiamondGreen.ssk
?????文件??????581632??2010-11-10?15:00??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\IrisSkin4.DLL
?????文件???????43520??2015-10-12?10:48??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\port_51.exe
?????文件?????????144??2015-10-10?10:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\port_51.exe.config
?????文件???????48640??2015-10-12?10:48??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\port_51.pdb
?????文件???????11600??2015-10-12?10:54??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\port_51.vshost.exe
?????文件?????????144??2015-10-10?10:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\port_51.vshost.exe.config
?????文件?????????490??2010-03-17?22:39??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Debug\port_51.vshost.exe.manifest
?????目錄???????????0??2015-10-12?12:27??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\bin\Release\
?????目錄???????????0??2015-10-12?12:17??(源代碼)C#作為上位機,控制51單片機(下位機),串口通信源程序\port_51\obj\
............此處省略34個文件信息
評論
共有 條評論