随笔分类 -  c#

摘要:1.先将要转换的json或者xml复制到粘贴板 2.在vs中选择下图所示操作,就可以转换为对应的类 注意: 生成的代码可能至少需要 .NET Framework 4.5 或 .NET Core/Standard 2.0。 阅读全文
posted @ 2020-01-08 17:05 Bridgebug 阅读(184) 评论(0) 推荐(0)
摘要:using System.Xml.Serialization; public class XMLOperate { public static void SerialXml<T>(T t, string path) { using (FileStream finfo = new FileStream 阅读全文
posted @ 2019-12-20 16:59 Bridgebug 阅读(317) 评论(0) 推荐(0)
摘要:/// <summary> /// 以枚举名称为Section,枚举值为Key的ini配置文件的读写 /// </summary> public class IniFileOperate : IniRW { protected Dictionary<object, string> _DefaultP 阅读全文
posted @ 2019-11-08 17:04 Bridgebug 阅读(214) 评论(0) 推荐(0)
摘要:1.对ini文件进行序列化和反序列化 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; public class IniDese 阅读全文
posted @ 2019-11-08 17:00 Bridgebug 阅读(455) 评论(0) 推荐(0)
摘要:/// <summary> /// 根据条件删除字典中所有符合的键值对 /// </summary> /// <returns></returns> public static int RemoveAll<TKey, TValue>(this IDictionary<TKey, TValue> so 阅读全文
posted @ 2019-11-08 16:48 Bridgebug 阅读(303) 评论(0) 推荐(0)
摘要:1.代码编辑 CTRL+E,D 格式化所选文档全部代码 CTRL+E,C / CTRL+K,CTRL+C 注释选定内容 CTRL+E,U / CTRL+K,CTRL+U 取消选定注释内容 CTRL+SHIFT+V 剪贴板循环 CTRL+DELETE 删除至词尾 CTRL+BACKSPACE 删除至词 阅读全文
posted @ 2019-10-23 09:03 Bridgebug 阅读(637) 评论(0) 推荐(0)
摘要:1.开启进程 using System.Diagnostics; ProcessStartInfo process = new ProcessStartInfo(); process.FileName = "要开启的进程路径"; string arg1 = "进程参数1"; string arg2 阅读全文
posted @ 2019-06-21 11:24 Bridgebug 阅读(1630) 评论(0) 推荐(0)
摘要:string ip = “”; System.Net.IPAddress ipAddress; if (System.Net.IPAddress.TryParse(ip, out ipAddress)) { return true; } else { return false; } 阅读全文
posted @ 2019-06-14 15:38 Bridgebug 阅读(1294) 评论(0) 推荐(0)
摘要:https://referencesource.microsoft.com/download.html 阅读全文
posted @ 2019-05-08 14:24 Bridgebug 阅读(262) 评论(0) 推荐(0)
摘要:/// <summary> /// 将一个文件夹下的所有东西复制到另一个文件夹 (可备份文件夹) /// </summary> /// <param name="sourceDire">源文件夹全名</param> /// <param name="destDire">目标文件夹全名</param> 阅读全文
posted @ 2019-04-29 10:11 Bridgebug 阅读(2027) 评论(0) 推荐(0)
摘要:1.Panel中控件Location设置是基于界面上位置 《(0,0)永远在左上角》,和Scroll没关系 2.当滑动Scroll时,Panel中的所有控件的Location都发生了改变 3.当Scroll不在原始位时设置控件Location为(0,0)会导致Panel上方有空白 阅读全文
posted @ 2019-04-18 16:17 Bridgebug 阅读(560) 评论(0) 推荐(0)
摘要:问题:在vs2010中的窗体设计时,明明在designer.cs中有控件的代码,但是在窗体设计器中没有显示控件 解决: 看窗体构造函数中是否有 InitializeComponent(); 有可能在designer.cs中没有将控件添加入父控件 例如:this.Controls.Add(this.g 阅读全文
posted @ 2019-03-05 13:43 Bridgebug 阅读(1664) 评论(0) 推荐(0)
摘要:百度网盘三方dll ps:. net framework 4.0 client profile 下不行 using Spire.Pdf; using Spire.Pdf.Graphics; using System.Diagnostics; PdfDocument doc = new PdfDocu 阅读全文
posted @ 2019-02-12 14:53 Bridgebug 阅读(572) 评论(0) 推荐(0)
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; 阅读全文
posted @ 2019-02-12 14:11 Bridgebug 阅读(1371) 评论(0) 推荐(0)
摘要:using System.Runtime.InteropServices; //WinAPI引用命名空间 /// <summary> /// 将Byte转换为结构体类型 /// </summary> /// <param name="bytes"></param> /// <param name=" 阅读全文
posted @ 2019-01-21 10:30 Bridgebug 阅读(570) 评论(0) 推荐(0)
摘要:打开解决方案文件夹,显示隐藏文件夹,找到下面文件夹并删除,重新打开后就OK了 阅读全文
posted @ 2018-11-08 13:56 Bridgebug 阅读(285) 评论(0) 推荐(0)