![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
文章平均质量分 74
lzl640
这个作者很懒,什么都没留下…
展开
-
AES加解密 随机向量 密文一次一变 C#与PHP 程序加解密互通
【代码】AES加解密 随机向量 密文一次一变 C#与PHP 程序加解密互通。原创 2022-10-21 15:28:27 · 575 阅读 · 0 评论 -
C# 简单实现OPC DA Client 转 Modbus TCP Server【浮点数为例】
很多工控环境,数据集中在OPC服务器上, 终端设备需要opc_da采集,很困难,即便终端是Windows系统,OPC的环境配置也及其麻烦,而终端若非Windows系统,基本上不太可能实现。现有能找见的转换工具要么付费;要么破解的老版本,很多bug。靠人不如靠自己,还是自己写的更方便。OpcNetApi + NModbus4 + Newtonsoft。原创 2022-09-03 18:39:45 · 2728 阅读 · 2 评论 -
C#实现海康威视设备自动批量实时校时
1、编写类库,关键部分:登录、读设备时间、设备校时using System;using System.Collections.Generic;using System.Linq;using System.Runtime.InteropServices;using System.Text;public class HIK_NVR{ public int m_lUserID = -1; public string ip; public ushort port = 800原创 2022-01-17 08:53:54 · 3637 阅读 · 4 评论 -
C#简单连接Oracle数据库
1、添加依赖库引用:2、编写帮助类库using Oracle.ManagedDataAccess.Client;using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Text;namespace DB_Helper4Oracle{ public class oracle_helper { public string ip原创 2020-08-25 11:56:07 · 381 阅读 · 0 评论 -
C#简单实现实现TCP服务器多线程数据接收
1、引入依赖库,无需第三方。using System;using System.Collections.Generic;using System.Data;using System.IO;using System.Net;using System.Net.Sockets;using System.Text;using System.Threading;using System.Windows.Forms;2、变量声明 /// <summary>原创 2020-07-05 09:01:39 · 8088 阅读 · 6 评论 -
C#轻松创建ModbusTCP服务器【Slave】,实现工业数据交换接口。
1、依赖库:NModbus4https://github.com/NModbus4/NModbus42、全局变量声明:/// <summary>/// 服务器提供的数据区/// </summary>public static DataStore Data;/// <summary>/// Modbus服务器/// </summary>public static ModbusSlave modbus_tcp_server;3、创建Mod原创 2020-06-19 16:10:45 · 7725 阅读 · 2 评论 -
C#程序模拟网站服务器(如PHP、ASP等任意类型)接收GET、POST请求信息,实现REST_API接口服务
1、依赖环境Newtonsoft JSON库,严重依赖LogHelper 自写的日志记录库 只记录调试信息 可替换或不用2、类的实现代码using Newtonsoft.Json.Linq;using System;using System.Collections.Generic;using System.Collections.Specialized;using System.IO;using System.Linq;using System.Net;using System.T原创 2020-06-06 20:03:13 · 733 阅读 · 0 评论 -
环保212协议(HJT 212-2017) 数据接收后的解码_C#实现
1、解码类代码:using LogHelper;using System;using System.Collections.Generic;using System.Linq;using System.Text;public class HJ212_2017{ /// <summary> /// 数据帧头 /// </summary>...原创 2020-04-06 14:13:53 · 9823 阅读 · 7 评论 -
C#引用S7netplus库通过网络读写西门子S7_200_SMART点位
@【利用S7netplus读写西门子S7_200_SMART点位C#引用S7netplus库读写西门子S7_200_SMART点位新建C#项目,由于S7netplus库原因,选择.net 4.5.2及以上版本原创 2020-03-24 10:33:21 · 9606 阅读 · 5 评论 -
海康威视道闸进出口LED屏DS-TVL224系列开发C#源码
1、类库源码:using System;using System.Collections.Generic;using System.Drawing;using System.Linq;using System.Net;using System.Net.Sockets;using System.Text;using System.Threading;namespace LS_H...原创 2019-12-23 14:28:10 · 4263 阅读 · 8 评论