c# - ASP.NET running an EXE File -


I am trying to run an old .NET application from an asp.net website. Reading the web and Stackoverflow (for the same problem) I have come to the following code The problem is that I always get an error code (I am using an admin account only for testing purposes). If i manually run the exe then it works fine

  Execute private zeroes (string sPath) {System.Diagnostics.Process proc = new System.Diagnostics.Process (); Proc.StartInfo.UserName = "Admin"; String pass = "............."; System.Security.SecureString Secret = New System.Security.SecureString (); Agrachat (Four C Pass Pass) Secret AppendChar (C); Proc.StartInfo.Password = Incognito; Proc.StartInfo.WorkingDirectory = ConfigurationManager.AppSettings ["WorkingDirectory"]. ToString (); Proc.StartInfo.RedirectStandardOutput = True; Proc.StartInfo.RedirectStandardError = True; Proc.StartInfo.UseShellExecute = false; Proc.StartInfo.FileName = sPath; Proc.Start (); Proc.WaitForExit (); String result = proc.StandardOutput.ReadToEnd (); Response. Type (result + "+ proc.ExitCode); proc.Close ();}  

}

I will get the exit code: -10665 9, 874 result variable I'm using Windows 2008 with IIS 7.0

Thanks in advance,

ezquil

You may need to set proc.StartInfo.LoadUserProfile property to true So that the user's user profile content is loaded into the registry (AFAIK does not occur by default).

In addition to this, to see if there is a problem due to problems due to problem or if problems are going on in the process, Hello World, 'it may be academic to run the program.

In the end, as a step in an attempt to reduce the problem, you can use the ASP.NET process as an administrator or system credential To run with Want to see if the ASP.NET example is running under the account's permission, is part of the problem (but please do this only for troubleshooting).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -