• 大小: 0.06M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-03-28
  • 语言: C#
  • 标签: c#  

资源简介


基于modbus协议,有CRC16位的校验

资源截图

代码片段和文件信息

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

namespace WindowsApplication5
{
    public partial class CRC : Form
    {
        public CRC()
        {
            InitializeComponent();
        }
        private String u;
        private void button1_Click(object sender EventArgs e)
        {

            try
            {
                string t;
                int q;

                string s = textBox1.Text;
                int f = textBox1.Text.Length;
                s = s.Replace(“ “ ““);
                string[] c = new string[s.Length];
                if (s.Length / 2 != 0)
                    q = s.Length - 1;
                else
                    q = s.Length;
                for (int i = 2 j = 0 k = 0; j < q; j += 2 k++)
                {
                    c[k] = s.Substring(j i);//将s的字符串每两个字节赋值给string数组的一个内存

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

     文件      36864  2009-03-25 21:06  c#串口通信\WindowsApplication5\bin\Debug\WindowsApplication5.exe

     文件      48640  2009-03-25 21:06  c#串口通信\WindowsApplication5\bin\Debug\WindowsApplication5.pdb

     文件       5632  2005-12-08 14:51  c#串口通信\WindowsApplication5\bin\Debug\WindowsApplication5.vshost.exe

     文件       2850  2009-03-25 19:44  c#串口通信\WindowsApplication5\CRC.cs

     文件       3011  2009-03-25 19:33  c#串口通信\WindowsApplication5\CRC.Designer.cs

     文件       5814  2009-03-25 19:33  c#串口通信\WindowsApplication5\CRC.resx

     文件       6926  2009-03-25 21:06  c#串口通信\WindowsApplication5\Form1.cs

     文件       9409  2009-03-25 20:44  c#串口通信\WindowsApplication5\Form1.Designer.cs

     文件       6013  2009-03-25 20:44  c#串口通信\WindowsApplication5\Form1.resx

     文件       4475  2009-03-25 20:38  c#串口通信\WindowsApplication5\Form2.cs

     文件      15464  2009-03-25 20:38  c#串口通信\WindowsApplication5\Form2.Designer.cs

     文件       5814  2009-03-25 20:38  c#串口通信\WindowsApplication5\Form2.resx

     文件        180  2009-03-25 19:33  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.CRC.resources

     文件        956  2009-03-25 20:44  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.csproj.GenerateResource.Cache

     文件      36864  2009-03-25 21:06  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.exe

     文件        180  2009-03-25 20:44  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.Form1.resources

     文件        180  2009-03-25 20:38  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.Form2.resources

     文件      48640  2009-03-25 21:06  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.pdb

     文件        180  2009-03-10 19:33  c#串口通信\WindowsApplication5\obj\Debug\WindowsApplication5.Properties.Resources.resources

     文件        444  2009-03-25 21:07  c#串口通信\WindowsApplication5\obj\WindowsApplication5.csproj.FileList.txt

     文件        478  2009-03-10 19:23  c#串口通信\WindowsApplication5\Program.cs

     文件       1186  2009-03-10 19:23  c#串口通信\WindowsApplication5\Properties\AssemblyInfo.cs

     文件       2892  2009-03-10 19:23  c#串口通信\WindowsApplication5\Properties\Resources.Designer.cs

     文件       5612  2009-03-10 19:23  c#串口通信\WindowsApplication5\Properties\Resources.resx

     文件       1102  2009-03-10 19:23  c#串口通信\WindowsApplication5\Properties\Settings.Designer.cs

     文件        249  2009-03-10 19:23  c#串口通信\WindowsApplication5\Properties\Settings.settings

     文件       3913  2009-03-25 19:33  c#串口通信\WindowsApplication5\WindowsApplication5.csproj

     文件        946  2009-03-10 19:23  c#串口通信\WindowsApplication5.sln

    ..A..H.     20992  2009-03-25 21:20  c#串口通信\WindowsApplication5.suo

     目录          0  2009-03-23 22:53  c#串口通信\WindowsApplication5\obj\Debug\Refactor

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

评论

共有 条评论