说明:该程序可能不具备实用性,仅测试用。

一、使用虚拟串口工具VSPD虚拟两个串口COM1和COM2

C#串口通信—传输文件测试

二、约定

占一个字节,代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace COMClient
{
    /// <summary>
    /// 约定
    /// </summary>
    public enum Protocol
    {
        Client端发送文件名 = 0,
        Client端发送数据块 = 1,
        Client端发送最后一个数据块 = 2,

        Server端本次接收完毕 = 3,
        Server端结束 = 4
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-05-22
  • 2022-12-23
猜你喜欢
  • 2021-08-11
  • 2021-07-21
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-05-11
  • 2021-12-10
相关资源
相似解决方案