2020年11月11日

摘要: /// <summary> /// 获取排序后的json字符串 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static string GetSortStrJson(object obj) 阅读全文
posted @ 2020-11-11 09:58 炼金师 阅读(1470) 评论(2) 推荐(1) 编辑

2020年11月10日

摘要: /// <summary> /// 结构体转bytes /// </summary> /// <param name="structObj">结构体</param> /// <param name="decCount">默认0,不截取</param> /// <returns></returns> 阅读全文
posted @ 2020-11-10 13:05 炼金师 阅读(401) 评论(0) 推荐(0) 编辑

2020年11月2日

摘要: /// <summary> /// 获得排完序的字典 /// </summary> /// <param name="parameters"></param> /// <returns></returns> public static Dictionary<string, object> GetAS 阅读全文
posted @ 2020-11-02 16:23 炼金师 阅读(139) 评论(0) 推荐(0) 编辑

2020年10月31日

摘要: 此为工具类,这个和java版本的加密对比过了,结果是一样的,代码赋值黏贴直接用,不多比比,直接上代码(需要在nuget上寻找"Portable.BouncyCastle"包安装): (java端有个和c#端不一样的地方,base64编码有好几套,有时候对不上大概率是base64那边的问题) usin 阅读全文
posted @ 2020-10-31 19:20 炼金师 阅读(5137) 评论(2) 推荐(1) 编辑
摘要: using System; using System.Security.Cryptography; using System.Text; public class AESUtil { /// <summary> /// AES加密 /// </summary> /// <param name="st 阅读全文
posted @ 2020-10-31 19:16 炼金师 阅读(803) 评论(0) 推荐(0) 编辑

2020年10月29日

摘要: /// <summary> /// 字符串转时间 /// </summary> /// <param name="dateString">时间字符串</param> /// <param name="format">时间的原始格式 比如yyyyMMdd(美国佬时间时可不设置)</param> /// 阅读全文
posted @ 2020-10-29 11:11 炼金师 阅读(1306) 评论(0) 推荐(0) 编辑

2020年10月20日

摘要: 老是忘记,怕闹笑话,还是记记的好: 1.创建项目 然后创建。 2.改下东西 3.创建类 4.代码: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Ne 阅读全文
posted @ 2020-10-20 10:12 炼金师 阅读(169) 评论(0) 推荐(0) 编辑

2020年8月23日

摘要: 我用的是HslCommunication(在vs的nuget上下在的,直接搜这个dll名字就行了),本来想用mqttnet的,发现新版本是3.多了,网上的教程都是2.7多了,我项目又比较急,我也懒得研究了,找到了一篇HslCommunication的用法,我整理了下。下面上代码 服务端: using 阅读全文
posted @ 2020-08-23 19:27 炼金师 阅读(2607) 评论(2) 推荐(0) 编辑

2020年8月18日

摘要: 长久不用vs会忘记,下面几个是我容易忘记的快捷键 1.全局查找 ctrl + shift + f 2.找某个类 ctrl + t 3.找某个文件 ctrl + shift + t 4.变小写 ctrl + u 5.变大写 ctrl + shift + u 阅读全文
posted @ 2020-08-18 08:51 炼金师 阅读(138) 评论(0) 推荐(0) 编辑

2020年8月12日

摘要: string fileName = "C:\\TempFloder\\" + "111.jpg";//文件名 FileStream fs = new FileStream(fileName, FileMode.Create); byte[] data = new byte[123];//用来存放字节 阅读全文
posted @ 2020-08-12 17:08 炼金师 阅读(561) 评论(0) 推荐(0) 编辑

导航