1

I am calling the following piece of code in my C# winforms app to open specific IE windows:

var IE = new SHDocVw.InternetExplorer();
        object URL = "http://google.com";

        IE.ToolBar = 0;
        IE.StatusBar = false;
        IE.MenuBar = true;
        IE.AddressBar = true;
        IE.Top = 0;
        IE.Left = 0;
        IE.Width = 2590;
        IE.Height = 2160;
        IE.Visible = true;
        IE.Navigate2(ref URL);

I do that for several IE windows and that works just fine but for one in particular I need to be able to specify it to Run As Different User (Shift + Right Click) and pass on those credentials.

Is that possible to be done with SHDocVw.InternetExplorer?

sd_dracula
  • 3,796
  • 28
  • 87
  • 158
  • If the calling code runs as that identity, the resulting IE process should as well... try http://stackoverflow.com/questions/125341/how-do-you-do-impersonation-in-net – Cee McSharpface May 31 '16 at 10:57
  • Yes, that works but I was trying to figure out a solution where you just click it and that happens in the background. i.e. the user should not be prompted for username/password – sd_dracula May 31 '16 at 11:13
  • Impersonation with `WindowsIdentity.Impersonate` will not cause the OS to show a prompt. You can assign domain, user name and password 'in the background'. – Cee McSharpface May 31 '16 at 12:23

0 Answers0