• 大小:
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-11
  • 语言: C#
  • 标签: C#  

资源简介

C#编写的串口通信程序,实现了基本的串口信息配置,收发消息等功能

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SerialPort port1 = new SerialPort();
        string InputData = String.Empty;
        delegate void SetTextCallback(string text);

        private void Port_Select()
        {//获取机器中的串口地址
            string[] ports = SerialPort.GetPortNames();
            foreach (string port in ports)
            {
                comboBox1.Items.Add(port);
            }
        }

        private void Form1_Load_1(object sender E

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\
     目录           0  2011-03-24 11:12  串口通讯C#\串口通讯C#\WindowsApplication1\
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\
     文件        3490  2010-08-13 10:15  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Form1.cs
     文件        8094  2010-08-13 10:01  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Form1.Designer.cs
     文件        5814  2010-08-13 10:01  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Form1.resx
     文件         478  2010-08-13 09:43  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Program.cs
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Properties\
     文件        1186  2010-08-13 09:43  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Properties\AssemblyInfo.cs
     文件        2894  2010-08-13 09:43  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Properties\Resources.Designer.cs
     文件        5612  2010-08-13 09:43  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Properties\Resources.resx
     文件        1104  2010-08-13 09:43  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Properties\Settings.Designer.cs
     文件         249  2010-08-13 09:43  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\Properties\Settings.settings
     文件        3245  2010-08-13 09:46  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\WindowsApplication1\串口通讯.csproj
     文件         932  2010-08-13 09:46  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\串口通讯.sln
     文件       12800  2010-08-13 10:15  串口通讯C#\串口通讯C#\WindowsApplication1\Backup\串口通讯.suo
     文件        4718  2011-03-24 11:12  串口通讯C#\串口通讯C#\WindowsApplication1\UpgradeLog.xml
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\bin\
     目录           0  2011-03-24 11:12  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\bin\Debug\
     文件       12800  2011-03-24 11:14  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\bin\Debug\WindowsApplication1.exe
     文件       36352  2011-03-24 11:14  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\bin\Debug\WindowsApplication1.pdb
     文件       14328  2011-04-04 17:30  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe
     文件         490  2007-07-21 08:33  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe.manifest
     文件        3490  2010-08-13 10:15  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\Form1.cs
     文件        8094  2010-08-13 10:01  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\Form1.Designer.cs
     文件        5814  2010-08-13 10:01  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\Form1.resx
     目录           0  2011-03-24 11:11  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\obj\
     目录           0  2011-03-24 11:14  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\obj\Debug\
     目录           0  2011-03-24 11:14  串口通讯C#\串口通讯C#\WindowsApplication1\WindowsApplication1\obj\Debug\TempPE\
............此处省略24个文件信息

评论

共有 条评论