没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
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 Com_zhx
{
public partial class Form1 : Form
{
#region**参数设置**
private static SerialPort sp = null;
private static Boolean isSetProperty = false;
private static String[] rates = { "2400", "4800", "9600", "19200", "38400", "43000", "56000", "57600", "115200"};
private static String[] paritys = { "None", "奇校验", "偶校验" };
private static String[] dataBits = { "5", "6", "7", "8" };
private static String[] stopBits = { "0","1", "1.5","2" };
#endregion
#region**初始化**
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
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 Com_zhx
{
public partial class Form1 : Form
{
#region**参数设置**
private static SerialPort sp = null;
private static Boolean isSetProperty = false;
private static String[] rates = { "2400", "4800", "9600", "19200", "38400", "43000", "56000", "57600", "115200"};
private static String[] paritys = { "None", "奇校验", "偶校验" };
private static String[] dataBits = { "5", "6", "7", "8" };
private static String[] stopBits = { "0","1", "1.5","2" };
#endregion
#region**初始化**
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//加载所有
//Com_zhx.Profile.SaveProfile();
Com_zhx.Profile.LoadProfile();
DTR.Enabled = false;
RTS.Enabled = false;
//加载可用串口,波特率,校验位,数据位,停止位
SearchPort();
Load_Rate();
Load_Parity();
Load_DataBits();
Load_StopBits();
Auto_SenT_Initialize();
}
#endregion
#region**搜索串口按钮**
private void Search_ComPort_Click(object sender, EventArgs e)
{
SearchPort();
}
#endregion
#region**开关串口**
private void Open_Port_Click(object sender, EventArgs e)
{
if (RS485.Checked)
{
Open_Port_485();
}
else
//加载所有
//Com_zhx.Profile.SaveProfile();
Com_zhx.Profile.LoadProfile();
DTR.Enabled = false;
RTS.Enabled = false;
//加载可用串口,波特率,校验位,数据位,停止位
SearchPort();
Load_Rate();
Load_Parity();
Load_DataBits();
Load_StopBits();
Auto_SenT_Initialize();
}
#endregion
#region**搜索串口按钮**
private void Search_ComPort_Click(object sender, EventArgs e)
{
SearchPort();
}
#endregion
#region**开关串口**
private void Open_Port_Click(object sender, EventArgs e)
{
if (RS485.Checked)
{
Open_Port_485();
}
else
剩余29页未读,继续阅读
资源评论
- 梁肖松2023-07-27什么意思?
weixin_39256722
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功