2012-11-27 64 views

回答

0

看一看在Process[MSDN]類。這應該讓你開始,如果你有任何麻煩,請發表另一個問題。

下面是鏈接的MSDN文檔的例子:

using System; 
using System.Diagnostics; 
using System.ComponentModel; 

namespace MyProcessSample 
{ 
    class MyProcess 
    { 
     public static void Main() 
     { 
      Process myProcess = new Process(); 

      try 
      { 
       myProcess.StartInfo.UseShellExecute = false; 

       // You can start any process. 
       // HelloWorld is a do-nothing example. 
       myProcess.StartInfo.FileName = "C:\\HelloWorld.exe"; 
       myProcess.StartInfo.CreateNoWindow = true; 
       myProcess.Start(); 

       // This code assumes the process you are starting will 
       // terminate itself. 
       // 
       // Given that is is started without a window so you cannot 
       // terminate it on the desktop, it must terminate itself 
       // or you can do it programmatically from this application 
       // using the Kill method. 
      } 
      catch (Exception e) 
      { 
       Console.WriteLine(e.Message); 
      } 
     } 
    } 
} 
0

只這一次,我給你的代碼。如果你想讓你的發射器更復雜,那部分取決於你。

class Program 
{ 
    public static void Main(string[] args) 
    { 
     Process process = new Process(); 
     process.StartInfo.FileName = args[0]; 
     process.StartInfo.UseShellExecute = false; 
     process.StartInfo.CreateNoWindow = true; 
     process.Start(); 
    } 
} 
相關問題