摘要: (运行场景 所有设备启动后 需要不间断的发送请求 然后接收请求 获取很多设备的运行状态 ) 通过与采集工控机去对接 对方工程师要求用ProtoBuf去转换对象传送数据 说是运行起来 会比json节省资源 速度会比json反应快些 回来查资料学习了一下 需要一下几步 第一步 创建 .proto 文件 阅读全文
posted @ 2020-08-26 05:40 Sorry名米 阅读(1037) 评论(0) 推荐(0) 编辑
摘要: 如果是双IP就不能用这种方式了 需要把ip写到配置文件中了 public static string GetLocalIP() { try { string IP = ConfigurationManager.AppSettings["LocalIP"]; if (string.IsNullOrWh 阅读全文
posted @ 2020-07-24 11:55 Sorry名米 阅读(102) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 获取FTP文档 /// </summary> /// <returns>路径</returns> public static string DisplayFileFromServer(Uri serverUri, out string errorMsg,strin 阅读全文
posted @ 2020-07-24 11:21 Sorry名米 阅读(818) 评论(0) 推荐(0) 编辑
摘要: using iTextSharp.text; using iTextSharp.text.pdf; /// <summary> /// 图片转成pdf /// </summary> public static void ConvertJPG2PDF(string jpgfile, string pd 阅读全文
posted @ 2020-07-24 11:14 Sorry名米 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 点击事件 public bool beginMove = false;//初始化鼠标位置 public int currentXPosition; public int currentYPosition; private void _MouseDown(object sender, MouseBut 阅读全文
posted @ 2020-07-24 11:00 Sorry名米 阅读(377) 评论(0) 推荐(0) 编辑
摘要: /// <summary>根据日期,获得星期几</summary> /// <param name="y">年</param> /// <param name="m">月</param> /// <param name="d">日</param> /// <returns>星期几,1代表星期一;7代 阅读全文
posted @ 2020-07-24 10:40 Sorry名米 阅读(121) 评论(0) 推荐(0) 编辑
摘要: public class NumberConvert { /// <summary> /// 转换数字 /// </summary> protected static long CharToNumber(char c) { switch (c) { case '一': return 1; case 阅读全文
posted @ 2020-07-24 10:37 Sorry名米 阅读(293) 评论(0) 推荐(0) 编辑
摘要: using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.L 阅读全文
posted @ 2020-07-24 10:34 Sorry名米 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1 public class Log 2 { 3 /// <summary> 4 /// 记录状态 5 /// </summary> 6 /// <param name="str">信息内容</param> 7 public static void WriteLog(string Message) 阅读全文
posted @ 2020-07-24 10:33 Sorry名米 阅读(125) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 文件转byte[] /// </summary> /// <param name="Path">绝对路径</param> /// <returns>byte[]</returns> public static byte[] FileToBytes(string P 阅读全文
posted @ 2020-07-24 10:29 Sorry名米 阅读(84) 评论(0) 推荐(0) 编辑