随笔分类 -  【常用功能】C# Winform

摘要:public static void CheckMutilApp() { var myProc = System.Diagnostics.Process.GetCurrentProcess(); var allProcs = System.Diagnostics.Process.GetProcess 阅读全文
posted @ 2021-06-24 09:02 月长生 阅读(131) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; using System.Threadi 阅读全文
posted @ 2021-06-23 08:37 月长生 阅读(42) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using 阅读全文
posted @ 2021-06-17 16:19 月长生 阅读(116) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net.Sockets; using Sy 阅读全文
posted @ 2021-06-16 08:58 月长生 阅读(54) 评论(1) 推荐(0) 编辑
摘要:在选项界面中将intellitrace的启用关闭后对于程序的打开有加速作用。 阅读全文
posted @ 2021-04-19 14:15 月长生 阅读(143) 评论(0) 推荐(0) 编辑
摘要:自动删除方法 public void AutoDel(int time, string path) { if (!string.IsNullOrEmpty(path)) { FileInfo file = new FileInfo(path); try { int addTime = Convert 阅读全文
posted @ 2021-04-14 17:21 月长生 阅读(96) 评论(0) 推荐(0) 编辑
摘要:隐藏:只需要将tabpage的parent设置为空即可 this.tabPage1.Parent = null; 重新显示只需将parent重新设置成tabcontrol的子项 this.tabPage1.Parent = this.tabControl1; this.tabControl1.Sel 阅读全文
posted @ 2021-04-14 16:00 月长生 阅读(312) 评论(0) 推荐(0) 编辑
摘要:先在构造器中添加keydown事件 tBoxPsw.KeyDown += TBoxPsw_KeyDown; 在事件中添加按下enter按钮所触发的方法 private void TBoxPsw_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode 阅读全文
posted @ 2021-03-29 14:36 月长生 阅读(44) 评论(0) 推荐(0) 编辑
摘要:获取当前程序源路径下的磁盘空间 Helper类的定义 public class Disk { public void GetHardDiskFreeSpace(string HardDiskName, ref long All, ref long Free) { HardDiskName = Har 阅读全文
posted @ 2021-03-17 09:44 月长生 阅读(38) 评论(0) 推荐(0) 编辑
摘要:public void XmlAdd(string filename, List<People> pList) { try { List<People> peoples = XmlDeSerializer(filename); foreach (var item in pList) { People 阅读全文
posted @ 2021-03-13 08:47 月长生 阅读(87) 评论(0) 推荐(0) 编辑
摘要:public void ExportExcel(DataTable dt) { //要添加epplus的nuget包 ExcelPackage.LicenseContext = LicenseContext.NonCommercial;//epplus的5.0版本以上的要加这行非商用声明 //新建一 阅读全文
posted @ 2021-03-09 17:29 月长生 阅读(110) 评论(0) 推荐(0) 编辑
摘要:class XmlHelp { #region 调用 /// <summary> /// xml添加 /// </summary> /// <param name="filename"></param> /// <param name="people"></param> public void Xm 阅读全文
posted @ 2021-03-09 09:27 月长生 阅读(52) 评论(0) 推荐(0) 编辑
摘要:public void SaveCSV(DataTable dt, string fullPath) { FileInfo fi = new FileInfo(fullPath); if (!fi.Directory.Exists) { fi.Directory.Create(); } FileSt 阅读全文
posted @ 2021-03-09 09:12 月长生 阅读(250) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示