1、额外打开进程关闭进程 (放在程序打开或者关闭时比如aubdioftp服务)
public static void StartFtpPress() { string path = System.Environment.CurrentDirectory; string fileName = path + "\\FtpAudio.exe"; System.Diagnostics.Process.Start(fileName); /* ProcessStartInfo info = new ProcessStartInfo(); info.FileName = path + "\\FtpAudio.exe"; info.Arguments = ""; //指定程序运行状态,最大化、最小化等 info.WindowStyle = ProcessWindowStyle.Maximized; Process pro = Process.Start(info); pro.WaitForExit(); */ } public static void CloseFtpPress() { //获得任务管理器中的所有进程 Process[] process = Process.GetProcesses(); foreach (Process p1 in process) { try { string processName = p1.ProcessName.ToLower().Trim(); //判断是否包含阻碍更新的进程 if (processName == "ftpaudio") { p1.Kill(); } } catch { } } }
2、
控制大小 比布局简单
private void Form1_Resize(object sender, System.EventArgs e) { this.panel1.Width = this.panel4.Width; this.panel1.Height = this.Height - this.panel4.Height-40; }
标签:info,额外,C#,System,Height,Process,p1,进程 From: https://www.cnblogs.com/cnchengv/p/17282445.html