您好,登錄后才能下訂單哦!
提供對(duì)本地和遠(yuǎn)程進(jìn)程的訪問(wèn)權(quán)限并使你能夠啟動(dòng)和停止本地系統(tǒng)進(jìn)程。
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();
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。