问题如下:
   1.Process ps=new Process();
     ps.StartInfo.FileName="c:\\abc\\abc.exe";
     ps.Start();   2.ShellExecute(this.Handle,"open","abc.exe","","c:\\abc\\", 5);   运行1报错,运行2可以,为什么?   abc.exe 是delphi编译完成的,换一个delphi可执行文件,上述两个都可以,为什么?

解决方案 »

  1.   

    try
    {
                System.Diagnostics.Process.Start("c:\\abc\\abc.exe");
    }
            catch ()
    {
                MessageBox.Show("not find !");
     }
      

  2.   

    还是直接用API安全些,.NET的属性把API几乎都封装了
      

  3.   

    Process ps=new Process();
    ps.StartInfo.FileName="c:\abc\abc.exe";
    ps.StartInfo.WorkingDirectory = @"c:\abc\";
    ps.Start();
      

  4.   

    sorry!Process ps=new Process();
    ps.StartInfo.FileName=@"c:\abc\abc.exe";
    ps.StartInfo.WorkingDirectory = @"c:\abc\";
    ps.Start();
      

  5.   

    Knight94(愚翁) 的回答正确,为什么要加ps.StartInfo.WorkingDirectory = @"c:\abc\";这一句呢?