**************************************************************************** //打开系统计算器 private void tsmiOpenCounter_Click(object sender, EventArgs e) { System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(); System.Diagnostics.Process proc = new System.Diagnostics.Process(); //设置外部程序名(记事本用 notepad.exe 计算器用 calc.exe) info.FileName = "calc.exe"; //设置外部程序的启动参数 info.Arguments = ""; //设置外部程序工作目录为c:/windows info.WorkingDirectory = "c:/windows/"; try { // //启动外部程序 // proc = System.Diagnostics.Process.Start(info); } catch { MessageBox.Show("系统找不到指定的程序文件", "错误提示!", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } //打开记事本 private void tsmiOpenWordpad_Click(object sender, EventArgs e) { System.Diagnostics.Process Proc; try { // 启动记事本 Proc = new System.Diagnostics.Process(); Proc.StartInfo.FileName = "notepad.exe"; Proc.StartInfo.UseShellExecute = false; Proc.StartInfo.RedirectStandardInput = true; Proc.StartInfo.RedirectStandardOutput = true; Proc.Start(); } catch { Proc = null; } }