C# 调用外部命令行源码

   Process myProcess = new Process();
            ProcessStartInfo myProcessStartInfo 
= new ProcessStartInfo(Server.MapPath("test.bat"));
            myProcessStartInfo.UseShellExecute 
= false;
            myProcessStartInfo.RedirectStandardOutput 
= true;
            myProcess.StartInfo 
= myProcessStartInfo;
            
//设置不显示窗口
            myProcess.StartInfo.CreateNoWindow = true;
            myProcess.Start();
            myProcess.Close();  

posted @ 2014-05-24 13:13  zzg168  阅读(148)  评论(0)    收藏  举报