C#调用.exe应用程序

using   System.Diagnostics;  
   如果是dos  
   Process.Start("cmd.exe");  
   如果是其他文件  
   Process.Start("绝对路径+文件名.exe");  
   ------------------------------------  
   如何在c#中调用外部dos程序?  
   使用Process对象:      
   System.Diagnostics.Process     p=new     System.Diagnostics.Process();      
   p.StartInfo.FileName="arj.exe"     ;//需要启动的程序名      
   p.StartInfo.Arguments="-x     sourceFile.Arj     c:\temp";//启动参数      
   p.Start();//启动      
   if(p.HasExisted)//判断是否运行结束      
     p.kill(); 

posted on 2009-02-06 16:03  曾伟  阅读(2185)  评论(0编辑  收藏  举报

导航