随笔分类 - 【常用功能】C# Winform
摘要:public static void CheckMutilApp() { var myProc = System.Diagnostics.Process.GetCurrentProcess(); var allProcs = System.Diagnostics.Process.GetProcess
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; using System.Threadi
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net.Sockets; using Sy
阅读全文
摘要:在选项界面中将intellitrace的启用关闭后对于程序的打开有加速作用。
阅读全文
摘要:自动删除方法 public void AutoDel(int time, string path) { if (!string.IsNullOrEmpty(path)) { FileInfo file = new FileInfo(path); try { int addTime = Convert
阅读全文
摘要:隐藏:只需要将tabpage的parent设置为空即可 this.tabPage1.Parent = null; 重新显示只需将parent重新设置成tabcontrol的子项 this.tabPage1.Parent = this.tabControl1; this.tabControl1.Sel
阅读全文
摘要:先在构造器中添加keydown事件 tBoxPsw.KeyDown += TBoxPsw_KeyDown; 在事件中添加按下enter按钮所触发的方法 private void TBoxPsw_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode
阅读全文
摘要:获取当前程序源路径下的磁盘空间 Helper类的定义 public class Disk { public void GetHardDiskFreeSpace(string HardDiskName, ref long All, ref long Free) { HardDiskName = Har
阅读全文
摘要:public void XmlAdd(string filename, List<People> pList) { try { List<People> peoples = XmlDeSerializer(filename); foreach (var item in pList) { People
阅读全文
摘要:public void ExportExcel(DataTable dt) { //要添加epplus的nuget包 ExcelPackage.LicenseContext = LicenseContext.NonCommercial;//epplus的5.0版本以上的要加这行非商用声明 //新建一
阅读全文
摘要:class XmlHelp { #region 调用 /// <summary> /// xml添加 /// </summary> /// <param name="filename"></param> /// <param name="people"></param> public void Xm
阅读全文
摘要:public void SaveCSV(DataTable dt, string fullPath) { FileInfo fi = new FileInfo(fullPath); if (!fi.Directory.Exists) { fi.Directory.Create(); } FileSt
阅读全文