Advertisement
Guest User

Untitled

a guest
Mar 28th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Process proc = new Process();
  2. System.Security.SecureString ssPwd = new System.Security.SecureString();
  3.  
  4. string password = "SomePassword";
  5. for (int x = 0; x < password.Length; x++)
  6. {
  7. ssPwd.AppendChar(password[x]);
  8. }
  9.  
  10. ProcessStartInfo StartInfo = new ProcessStartInfo
  11. {
  12. FileName = "Translink.exe",
  13. WorkingDirectory = @"C:Program FilesWestern UnionUniversal-Release",
  14. UserName = "someuser",
  15. Domain = "somedomain",
  16. Password = ssPwd,
  17. UseShellExecute = false,
  18. RedirectStandardOutput = true,
  19. RedirectStandardError = true
  20. };
  21. proc = Process.Start(StartInfo);
  22. proc.WaitForExit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement