
C#使用MQTT服务端与客户端应用实例
MQTT用的就是TCP/IP协议 ,Socket通讯,MQTT定义了一套自己的数据传输格式。 在这里我们引用的是MQTTnet.dll,它将数据的传输格式、数据监听和数据转发封装了,我们只要调用就可以。开源库地址:https://github.com/chkr1011/MQTTnet对应文档:https://github.com/chkr1011/MQT…
MQTT用的就是TCP/IP协议 ,Socket通讯,MQTT定义了一套自己的数据传输格式。 在这里我们引用的是MQTTnet.dll,它将数据的传输格式、数据监听和数据转发封装了,我们只要调用就可以。开源库地址:https://github.com/chkr1011/MQTTnet对应文档:https://github.com/chkr1011/MQT…
核心代码(在nuget上安装 Tesseract)public string TesseractOCR(Bitmap image){ //Tesseract.Page chi_sim为中文训练数据包 Page page = new TesseractEngine(AppDomain.CurrentDomain.BaseDirectory + @"\tessdata", "chi_sim", EngineMode.Default).Process…
public class IdWorker{ //机器ID private static long workerId; private static long twepoch = 687888001020L; //唯一时间,这是一个避免重复的随机量,自行设定不要大于当前时间戳 private static long sequence = 0L; private static int workerIdB…
//using PaddleOCRSharp;//using System.Drawing;public class PaddleOCREngineHandler{//本文来自www.luofenming.com public static PaddleOCREngine engine = CreateOCRParameter(); public static PaddleOCREngine CreateOCRParameter() { OCRParame…
/// summary/// Base64转图片/// /summary/// param name="data"/parampublic Image Base64ToImage(string data){ data = data.Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replac…
public bool ExistsChinese(string CString){ if (CString != null && CString.Length 0) { char[] cs = CString.ToArray(); foreach (char c in cs) { if (Convert.ToInt32(c) = 128) { return…
/** * 浏览器解析,浏览器、Node.js皆可 * https://github.com/mumuy/browser */; (function (root, factory) { if (typeof define === function && (define.amd || define.cmd)) { // AMD&CMD define(function () { return factory(root)…
视频讲解地址 https://www.bilibili.com/video/BV1iK411R7ch/mongodb服务端软件下载地址 https://www.mongodb.com/try/download/community我下载的包是mongodb-linux-x86_64-rhel80-6.0.3.tgz 放在了ceontos /opt 目录下解压文件tar -zxvf mongodb-linux-x86_64-rhel80-…
/// summary/// DateTime转时间戳 /// /summary/// param name="dt"DateTime/param/// returns时间戳(秒)/returnspublic static long GetUnixTimeStamp(DateTime dt){ DateTime dtStart = TimeZoneInfo.ConvertTimeFromUtc(new DateTime(1970, 1, 1, …
public class HttpHelper{ // Post请求 public string PostResponse(string url, string postData) { try { string result = string.Empty; //设置Http的正文 HttpContent httpContent = new StringContent…