捕捉到 System.ComponentModel.Win32Exception
  Message="拒绝访问。"
  Source="System"
  ErrorCode=-2147467259
  NativeErrorCode=5
  StackTrace:
       在 System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
       在 System.Diagnostics.Process.Start()
       在 Yqun.Client.StartAgent.LoginDialog.Upgrade()
  InnerException: 
 Process p = new Process();
                            ProcessStartInfo info = new ProcessStartInfo();
                            info.FileName = "ApplicationUpdate.exe";
                            info.Arguments = "\"" + ResponseContent+ "\"";
                            info.WorkingDirectory = Application.StartupPath;
                                                      p.StartInfo = info;                           
                            p.Start();
其中:ResponseContent为XML格式的字符串。但老报上面的那个错。请高手指教啊。谢谢。

解决方案 »

  1.   

    http://hi.baidu.com/yd514/blog/item/e9784f38e6bbd2f7b311c746.html
      

  2.   

    应该和你的xml文件格式有关系,ApplicationUpdate.exe是什么东西,有必要传xml吗,不可以传xml文件的fullname ?
      

  3.   

    这个xml是服务器上的一个文件的内容。如果传fullname。那么客户机上是没有这个文件的。我是在做自动升级服务的。谢谢啊。
      

  4.   

    这个xml是服务器上的一个文件生成的。而传fullname。在客户机上没有这个文件。所以只能传xml内容。我是在做自动升级的功能。
      

  5.   

    你那个ApplicationUpdate.exe时一个本地程序吗?为什么没有路径?还有传进来的Arguments是不是这个ApplicationUpdate.exe需要的参数呢?
      

  6.   

    Process.Start("ApplicationUpdate.exe \"" + ResponseContent+ "\""); 或
    Process p = new Process();                             ProcessStartInfo info = new ProcessStartInfo(); 
                                info.StartInfo.FileName = "cmd.exe"; 
                                info.StartInfo.Arguments = "/c ApplicationUpdate.exe \"" + ResponseContent+ "\"";                             info.WorkingDirectory = Application.StartupPath; 
                                                          p.StartInfo = info;                          
                                p.Start(); 
      

  7.   

    Process.Start("ApplicationUpdate.exe \"" + ResponseContent+ "\""); 或 
    Process p = new Process();                             ProcessStartInfo info = new ProcessStartInfo(); 
                                info.StartInfo.FileName = "cmd.exe"; 
                                info.StartInfo.Arguments = "/c ApplicationUpdate.exe \"" + ResponseContent+ "\"";                             info.WorkingDirectory = Application.StartupPath; 
                                                          p.StartInfo = info;                          
                                p.Start();