Re: [問題] 關於呼叫外部執行檔

看板C_Sharp作者 (XDXDXDXDXDXD)時間15年前 (2010/04/07 14:16), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
我都是這樣用的 Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.StartInfo.CreateNoWindow = true; p.StartInfo.FileName = "regedit.exe"; p.StartInfo.Arguments = "/s xd.reg"; p.Start(); p.WaitForExit(); ※ 引述《herman602 (奸商)》之銘言: : 通常呼叫外部執行檔之後 : 就會有視窗跑出來 : 但是我想要做到我呼叫外部執行檔之後 : 那個外部執行檔的console視窗不要跑出來 : 並且由主程式同時取得該外部程序PID : 發現外部PID不見了就代表外部程序執行完畢 : 再繼續主程式 : 請問有辦法隱藏外部程序的console視窗嗎? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.216.4.5

04/07 23:44, , 1F
成功了!!!感謝!!!
04/07 23:44, 1F
文章代碼(AID): #1Bl2DDXP (C_Sharp)
文章代碼(AID): #1Bl2DDXP (C_Sharp)