Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var proc = new Process
- {
- StartInfo = new ProcessStartInfo
- {
- FileName = GetASDeploymentExe(),
- Arguments = GetASDeploymentCmdArgs(),
- UseShellExecute = false,
- RedirectStandardOutput = true,
- RedirectStandardError = true,
- CreateNoWindow = true,
- Domain = "***",
- UserName = username,
- Password = secstr,
- Verb = "runas"
- }
- };
- proc.Start();
- config.ASDeploymentToolPID = proc.Id;
- string line = string.Empty;
- do
- {
- line = proc.StandardOutput.ReadLine();
- Console.WriteLine(line);
- } while (!proc.HasExited);
- string error = string.Empty;
- while (!proc.StandardError.EndOfStream)
- {
- error = proc.StandardError.ReadLine();
- Logger.WriteError(error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement