- 博客(12)
- 资源 (15)
- 收藏
- 关注
原创 创建xml
XmlDocument pXmlDocument = new XmlDocument(); XmlDeclaration pXmlDeclaration = pXmlDocument.CreateXmlDeclaration("1.0", "utf-8", null); pXmlDocument.AppendChild(pXmlDeclaration); //加入一个根元素 Xml
2023-09-06 16:43:12 52
原创 高低位转换
public byte[] ReversalHighLow(int num) { byte[] b = new byte[2]; UInt16 result = (UInt16)(num); b[0] = (byte)(result >> 8);//高位 b[1] = (byte)(result & 0xff);//低位 return b; }
2023-09-06 09:51:30 62
原创 .net core webapi导出Excel
/// /// 导出Export /// /// [HttpGet("GetExport")] public ActionResult GetExport() { daochu.ExportData(out MemoryStream stream); return File(stream...
2022-07-26 16:44:41 535 1
原创 Modbus RTU CRC16校验和计算(高字节在前)
staticboolCRC16(byte[] pDataBytes){byte[] CheckDatas = pDataBytes.Skip(0).Take(pDataBytes.Length - 2).ToArray();byte[] CRCDatas = pDataBytes.Skip(pDataBytes.Length - 2).Take(2).ToArray();//预置 1 个 16 位的寄...
2021-10-23 15:25:31 2057
原创 c# windows 服务安装代码
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.ServiceProcess;using System.Configuration.Install;using S
2020-12-10 17:09:36 235
原创 C#实现Access通用访问类OleDbHelper完整实例
C#实现Access通用访问类OleDbHelper完整实例using System;using System.Collections;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.Common;using System.Data.OleDb;namesp...
2019-02-27 11:06:46 288
原创 C# TCP/IP客户端与服务端数据与文件的传输
用C#写的 一个简单的TCP通信,主要的功能有:(1) 多个客户端与服务器间的数据交流(2)可以实现群发的功能(3)客户端与服务端可以进行文件的传输主要用到的知识: TCP里的 socket 、多线程 Thread下面分别是服务端和客户端的代码:服务端代码:using System;using System.Collections.Generic;using System.Com...
2019-01-25 10:58:56 2913 7
原创 C# Timer 定时任务
C#中,Timer是一个定时器,它可以按照指定的时间间隔或者指定的时间执行一个事件。指定时间间隔是指按特定的时间间隔,如每1分钟、每10分钟、每1个小时等执行指定事件;指定时间是指每小时的第30分、每天10:30:30(每天的10点30分30秒)等执行指定的事件;在上述两种情况下,都需要使用 Timer.Interval,方法如下:1、按特定的时间间隔:复制代码复制代码using S...
2019-01-25 10:51:11 178
Log4net配置实例(LogHelper类).zip
2020-12-15
svn的64位安装包
2020-10-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人