-
I have a WebBrowser Control on the main form of my app. I plan to bundle an HTML page with the install and have it display in the control.
That part I have no problem with, but what I would like to do is to check for a valid internet connection and if there is one, to display that page in the WebBrowser control.
My question is how do I check for the connection and if it's not there, display my bundled HTML page instead of the "Invalid URL" page that the control loads by default.
Thanks in advance for any help.
-
http://www.mvps.org/vbnet/code/netwo...ectedstate.htm
And to remove the Invalid page message just include this in the form_load event
WebBrowserCtl.Navigate "about:blank"
That will show a blank page and eliminate the Invalid page(address) Then after you check for the net connection you can redirect it to the appropriate page.
[Edited by Glacius Cool on 09-12-2000 at 05:55 PM]
-
This method works some times:
Code:
Label1.Caption = Winsock1.LocalIP
If Label1.Caption = "" Then
WebBrowser1.Navigate ("C:\index.html")
End If
or
Registry way
Just add an IfThen Statment at the end of that code.
Gl,
D!m
-
Thanks a lot Glacius and Dim. I will try both of your suggestions.
Dim:
Why does the Winsock method only work sometimes?