2

I need to impersonate the WinForms Webbrowser Control. For impersonating I'm using the AliasAccount class from here: Open remote shared folder with credentials

It works great but not with the WebBrowser control.

Dim aa As New AliasAccount(DomainName & "\" & UserName, mypassword)

Dim aa As New AliasAccount(DomainName & "\" & UserName, mypassword)

aa.BeginImpersonation()

Dim webImp As New WebBrowser
webImp.Height = 220
webImp.Width = 220
webImp.Location = New Point(390, 208)
webImp.Navigate("http://www.google.com")

Me.Controls.Add(webImp)
aa.EndImpersonation()

I see the control in my form but the webImp.Navigate("www.google.ch") does not work! I don't know why. Does somebody have an idea?

If I check the ReadyState of the Webbrowser:

Do While wbImp.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
Loop

It never stops. It's keeping in the loop.

Community
  • 1
  • 1
syntax412
  • 81
  • 1
  • 9

0 Answers0