有時我們需要在C#程序中啟動外部的程序,這如何實現呢?我們可以借助System.Diagnostics.Process提供的Start方法來實現,下面用3個例子來說明:
(1)程序中打開網頁
System.Diagnostics.Process.Start("iexplore.exe",“http://www.companysz.com”);
System.Diagnostics.Process.Start();
(2)程序中打開記事本
System.Diagnostics.Process.Start("notepad.exe")
(3)程序中打開計算器
System.Diagnostics.Process.Start("calc.exe")
新聞熱點
疑難解答
圖片精選