I am developing an application in vb.net which fetches some information from the system and then update the details collected to a ready made webpage. I am using the InternetExplorer object for the same. Please find the code below.
Dim WebBrowser1 As Object = CreateObject("InternetExplorer.Application")
Private Sub Button1_Click(sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
WebBrowser1.Visible = True
WebBrowser1.Navigate("http://abcd.com/webform1.aspx")
While WebBrowser1.ReadyState <> WebBrowserReadyState.Complete
Application.DoEvents()
End While
WebBrowser1.Document.GetElementById("infoUserName").InnerText = EndUserName
Here the While condition generates an exception and says that
The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
I have resolved the issue. The url connect.microsoft.com/IE/feedback/details/806858/… explains it more. I have enabled protected mode in IE and it started working fine
User contributions licensed under CC BY-SA 3.0