• 大小: 0.23M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 串口通信  通信  串口  

资源简介

采用杜洋工作室的学习例子 

资源截图

代码片段和文件信息

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.IO.Ports;
namespace SerialCommunicate
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
        }

        private void button1_Click(object sender EventArgs e)
        {
            try
            {
                serialPort1.PortName = comboBox1.Text;
                serialPort1.BaudRate = Convert.ToInt32(comboBox2.Text10);//十进制数据转换
                serialPort1.Open();
                button1.Enabled = false;//打开串口按钮不可用

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-11-01 13:14  SerialCommunicate\
     目录           0  2019-11-01 13:14  SerialCommunicate\.vs\
     目录           0  2019-11-01 13:14  SerialCommunicate\.vs\SerialCommunicate\
     目录           0  2019-11-03 15:29  SerialCommunicate\.vs\SerialCommunicate\v15\
     文件       54784  2019-11-03 16:26  SerialCommunicate\.vs\SerialCommunicate\v15\.suo
     文件      253952  2019-11-03 15:29  SerialCommunicate\.vs\SerialCommunicate\v15\Browse.VC.db
     目录           0  2019-11-01 13:14  SerialCommunicate\.vs\SerialCommunicate\v15\Server\
     目录           0  2019-11-01 13:45  SerialCommunicate\.vs\SerialCommunicate\v15\Server\sqlite3\
     文件           0  2018-06-10 08:44  SerialCommunicate\.vs\SerialCommunicate\v15\Server\sqlite3\db.lock
     文件      561152  2018-06-16 14:27  SerialCommunicate\.vs\SerialCommunicate\v15\Server\sqlite3\storage.ide
     文件       32768  2019-11-03 16:26  SerialCommunicate\.vs\SerialCommunicate\v15\Server\sqlite3\storage.ide-shm
     文件      107152  2019-11-01 15:13  SerialCommunicate\.vs\SerialCommunicate\v15\Server\sqlite3\storage.ide-wal
     目录           0  2019-11-02 17:29  SerialCommunicate\.vs\SerialCommunicate\v15\ipch\
     目录           0  2019-11-03 16:27  SerialCommunicate\.vs\SerialCommunicate\v15\ipch\AutoPCH\
     目录           0  2019-11-01 13:14  SerialCommunicate\SerialCommunicate\
     文件       13887  2013-07-19 23:53  SerialCommunicate\SerialCommunicate\Form1.Designer.cs
     文件        5219  2018-06-10 19:23  SerialCommunicate\SerialCommunicate\Form1.cs
     文件        6189  2013-07-18 00:19  SerialCommunicate\SerialCommunicate\Form1.resx
     文件         498  2013-07-16 12:52  SerialCommunicate\SerialCommunicate\Program.cs
     目录           0  2019-11-01 13:14  SerialCommunicate\SerialCommunicate\Properties\
     文件        1372  2013-07-16 12:52  SerialCommunicate\SerialCommunicate\Properties\AssemblyInfo.cs
     文件        2886  2013-07-16 12:52  SerialCommunicate\SerialCommunicate\Properties\Resources.Designer.cs
     文件        5612  2013-07-16 12:52  SerialCommunicate\SerialCommunicate\Properties\Resources.resx
     文件        1104  2013-07-16 12:52  SerialCommunicate\SerialCommunicate\Properties\Settings.Designer.cs
     文件         249  2013-07-16 12:52  SerialCommunicate\SerialCommunicate\Properties\Settings.settings
     文件        3747  2013-07-16 12:54  SerialCommunicate\SerialCommunicate\SerialCommunicate.csproj
     目录           0  2019-11-01 13:14  SerialCommunicate\SerialCommunicate\bin\
     目录           0  2019-11-01 13:14  SerialCommunicate\SerialCommunicate\bin\Debug\
     文件       14848  2019-11-01 13:45  SerialCommunicate\SerialCommunicate\bin\Debug\SerialCommunicate.exe
     文件       24064  2019-11-01 13:45  SerialCommunicate\SerialCommunicate\bin\Debug\SerialCommunicate.pdb
     文件       22472  2013-07-19 23:53  SerialCommunicate\SerialCommunicate\bin\Debug\SerialCommunicate.vshost.exe
............此处省略17个文件信息

评论

共有 条评论