• 大小: 0.08M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: 实例  串口  

资源简介

实现16进制和ASCII的发送和接收,基本实现串口助手功能,给初学者和刚接触串口的朋友一点参考。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
using System.Text.Regularexpressions;

namespace hjCommunication
{
    public class hjSerialPortComm
    {

        public SerialPort Comm { get; private set; }
        public bool IsOpen { get { return Comm.IsOpen; } }
        
        public CodeType ReceiveShowCodeType { get; set; }
        public CodeType SendCodeType { get; set; }

        public event Action DataReceivedEvent;

        //构造器
        public hjSerialPortComm()
        {
            Comm = new SerialPort();
            ReceiveShowCodeType = SendCodeType = CodeType.ASCII;

        }

        public void SetParams(string portName)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8192  2016-07-02 17:37  hjCommunication\hjCommunication\bin\Debug\hjCommunication.dll

     文件      15872  2016-07-02 17:37  hjCommunication\hjCommunication\bin\Debug\hjCommunication.pdb

     文件       2536  2016-07-02 15:16  hjCommunication\hjCommunication\hjCommunication.csproj

     文件       3621  2016-07-02 16:01  hjCommunication\hjCommunication\hjSerialPortComm.cs

     文件       6439  2016-07-02 15:12  hjCommunication\hjCommunication\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        288  2016-07-02 17:37  hjCommunication\hjCommunication\obj\Debug\hjCommunication.csproj.FileListAbsolute.txt

     文件       8192  2016-07-02 17:37  hjCommunication\hjCommunication\obj\Debug\hjCommunication.dll

     文件      15872  2016-07-02 17:37  hjCommunication\hjCommunication\obj\Debug\hjCommunication.pdb

     文件          0  2016-07-02 09:57  hjCommunication\hjCommunication\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2016-07-02 09:57  hjCommunication\hjCommunication\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2016-07-02 09:57  hjCommunication\hjCommunication\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       1370  2016-07-02 09:55  hjCommunication\hjCommunication\Properties\AssemblyInfo.cs

     文件       1401  2016-07-02 15:16  hjCommunication\hjCommunication.sln

    ..A..H.     51200  2016-07-03 22:41  hjCommunication\hjCommunication.v11.suo

     文件        144  2016-07-02 15:59  hjCommunication\Test\app.config

     文件       8192  2016-07-02 17:37  hjCommunication\Test\bin\Debug\hjCommunication.dll

     文件      15872  2016-07-02 17:37  hjCommunication\Test\bin\Debug\hjCommunication.pdb

     文件      17920  2016-07-02 17:37  hjCommunication\Test\bin\Debug\Test.exe

     文件        144  2016-07-02 15:59  hjCommunication\Test\bin\Debug\Test.exe.config

     文件      28160  2016-07-02 17:37  hjCommunication\Test\bin\Debug\Test.pdb

     文件      22472  2016-07-03 22:41  hjCommunication\Test\bin\Debug\Test.vshost.exe

     文件        144  2016-07-02 15:59  hjCommunication\Test\bin\Debug\Test.vshost.exe.config

     文件        490  2009-08-31 00:40  hjCommunication\Test\bin\Debug\Test.vshost.exe.manifest

     文件       4951  2016-07-02 17:37  hjCommunication\Test\Form1.cs

     文件      21059  2016-07-02 17:37  hjCommunication\Test\Form1.Designer.cs

     文件       5817  2016-07-02 17:37  hjCommunication\Test\Form1.resx

     文件       1135  2016-07-02 15:59  hjCommunication\Test\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6915  2016-07-03 22:41  hjCommunication\Test\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2016-07-02 15:59  hjCommunication\Test\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2016-07-02 15:59  hjCommunication\Test\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

............此处省略35个文件信息

评论

共有 条评论