提供对本地和远程进程的访问权限并使你能够启动和停止本地系统进程。

Process可以打开文件,也可以打开exe的运行程序

现在先来说一下如何打开word文档:

string fileNewPat = Application.StartupPath; string fileName = fileNewPat+@"\doc\程沐喆.doc"; if (File.Exists(fileName)) { Process process1 = new Process(); process1.StartInfo.FileName = fileName; process1.StartInfo.Arguments = ""; process1.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; process1.Start(); } else { MessageBox.Show("文件不存在"); }

打开Config文件:

string stConfigFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); stConfigFileName = Path.Combine(stConfigFileName, "UserConfigSettings"); stConfigFileName += @".config";

打开Windows自带的计算器程序:

Process process1 = new Process(); process1.StartInfo.FileName = "calc.exe"; process1.StartInfo.Arguments = ""; process1.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; process1.Start();