(1) publicbool Start ()
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "iexplore.exe"; //IE浏览器,可以更换
process.StartInfo.Arguments = "http://www.baidu.com";
process.Start();
(2) publicstaticProcessStart (ProcessStartInfostartInfo)
System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo();
processStartInfo.FileName = "explorer.exe"; //资源管理器
processStartInfo.Arguments = @"D:\";
System.Diagnostics.Process.Start(processStartInfo);
(3) publicstaticProcessStart (stringfileName)
System.Diagnostics.Process.Start(@"D:\Program Files\Tencent\QQ\Bin\QQ.exe"); //直接调用打开文件
(4) Process.Start (StringfileName, Stringarguments)
System.Diagnostics.Process.Start("explorer.exe", "D:\\Readme.txt"); //直接打开文件Readme.txt
上面已经举例了用process.start()打开网站的方法,现在讲讲用processs.star()定位到某个文件的方法。