2009-02-02 28 views

Trả lời

6

Đó là hoàn toàn có thể, ví dụ:

System.Diagnostics.Process.Start(@"C:\listfiles.bat"); 
3

Kiểm tra ví dụ này từ C# Station

using System; 
using System.Diagnostics; 

namespace csharp_station.howto 
{ 
    /// <summary> 
    /// Demonstrates how to start another program from C# 
    /// </summary> 
    class ProcessStart 
    { 
     static void Main(string[] args) 
     { 
      Process notePad = new Process(); 

      notePad.StartInfo.FileName = "notepad.exe"; 
      notePad.StartInfo.Arguments = "ProcessStart.cs"; 

      notePad.Start(); 
     } 
    } 
} 
2

Bạn cũng có thể làm điều này:

System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(); 
    info.UseShellExecute = true; 
    info.FileName = "iisreset"; 
    System.Diagnostics.Process.Start(info); 



    Console.ReadLine(); 
Các vấn đề liên quan