Guest User

Untitled

a guest
Nov 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public ProcessStartInfo GetProcessStartInfo(string domain,string username, string password, string path,string args)
  2. {
  3. SecureString securePwd = new SecureString();
  4. foreach (char ch in _password)
  5. securePwd.AppendChar(ch);
  6.  
  7.  
  8. ProcessStartInfo processInfo = new ProcessStartInfo(path);
  9.  
  10. processInfo.UserName = username;
  11. processInfo.Password = securePwd;
  12. processInfo.Domain = _domain;
  13.  
  14. processInfo.Arguments = args;
  15.  
  16. return processInfo;
  17. }
Add Comment
Please, Sign In to add comment