code_junkie

Passing AD authentication credentials to IE browser in C# Windows Form

Nov 13th, 2011
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. SecureString sec = new SecureString();
  2. sec.AppendChar('1');
  3. sec.AppendChar('2');
  4. sec.AppendChar('3');
  5.  
  6. Process.Start("IEXPLORE.EXE", url,"abc",sec,"moss.local");
  7.  
  8. ProcessStartInfo startInfo = new ProcessStartInfo(@"c:Program FilesInternet Exploreriexplore.exe", "http://server/sites/spsite/page.aspx");
  9. startInfo.UserName = @"user";
  10. SecureString p = new SecureString();
  11. p.AppendChar('p');
  12. p.AppendChar('w');
  13. p.AppendChar('d');
  14. startInfo.Password = p;
  15. startInfo.Domain = "mydomain";
  16. startInfo.UseShellExecute = false;
  17. Process.Start(startInfo);
Add Comment
Please, Sign In to add comment