Advertisement
Guest User

Untitled

a guest
Sep 16th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. System.Diagnostics.Process proc = new System.Diagnostics.Process();
  2. System.Security.SecureString ssPwd = new System.Security.SecureString();
  3.  
  4. proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
  5. proc.StartInfo.CreateNoWindow = false;
  6. proc.StartInfo.FileName = FindExecutable(cFileName);
  7. proc.StartInfo.WorkingDirectory = Path.GetDirectoryName(path);
  8. proc.StartInfo.Arguments = " C:\Ref doc 1.pdf";
  9. proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
  10. proc.StartInfo.Domain = "XXXX";
  11. proc.StartInfo.UserName = "Administrator";
  12.  
  13. string password = "xxxxxx";
  14. for (int x = 0; x < password.Length; x++)
  15. {
  16. ssPwd.AppendChar(password[x]);
  17. }
  18.  
  19.  
  20. proc.StartInfo.Password = ssPwd;
  21. proc.StartInfo.UseShellExecute = false;
  22. proc.Start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement