我通过webform调用Process.Start时,页面提示找不到要执行的应用程序,已经确认该应用程序是存在的。为什么不能执行呢? 应该怎样才能执行?谢谢

解决方案 »

  1.   

    以下例子为启动win日志查看器
    System.Diagnostics.ProcessStartInfo  Info  =  new  System.Diagnostics.ProcessStartInfo();
    Info.FileName="eventvwr.msc";
    Process p=new Process();
    p.StartInfo=Info;
    p.Start();
    以下是启动一个自己写的应用程序
    System.Diagnostics.ProcessStartInfo  Info  =  new  System.Diagnostics.ProcessStartInfo();
    Info.FileName="cmd.exe";
    Info.RedirectStandardOutput=true;
    Info.Arguments=@"/C e:\sxrtest\test\d\ConsoleApplication1.exe";
    Info.UseShellExecute=false;
    System.Diagnostics.Process myP = new Process();
    myP.StartInfo=Info;
    myP.Start();
    主要是确定启动程序的路径要对,一般在path中的可不指定路径
      

  2.   

    webform中代码代用process.start是启动的服务器上的程序,而不是客户端的