提供對(duì)本地和遠(yuǎn)程進(jìn)程的訪問(wèn)權(quán)限并使你能夠啟動(dòng)和停止本地系統(tǒng)進(jìn)程。
成都創(chuàng)新互聯(lián)10多年企業(yè)網(wǎng)站建設(shè)服務(wù);為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁(yè)設(shè)計(jì)及高端網(wǎng)站定制服務(wù),企業(yè)網(wǎng)站建設(shè)及推廣,對(duì)成都PE包裝袋等多個(gè)方面擁有多年的營(yíng)銷(xiāo)推廣經(jīng)驗(yàn)的網(wǎng)站建設(shè)公司。
Process可以打開(kāi)文件,也可以打開(kāi)exe的運(yùn)行程序
現(xiàn)在先來(lái)說(shuō)一下如何打開(kāi)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("文件不存在");
}
打開(kāi)Config文件:
string stConfigFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
stConfigFileName = Path.Combine(stConfigFileName, "UserConfigSettings");
stConfigFileName += @".config";
打開(kāi)Windows自帶的計(jì)算器程序:
Process process1 = new Process();
process1.StartInfo.FileName = "calc.exe";
process1.StartInfo.Arguments = "";
process1.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process1.Start();