|
-
Sep 12th, 2000, 04:27 PM
#1
Thread Starter
Lively Member
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.
-
Sep 12th, 2000, 04:49 PM
#2
Member
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]
Glacius Cool
Concept Designer
VB5sp4,VC++6sp3
-
Sep 12th, 2000, 04:49 PM
#3
Fanatic Member
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
-
Sep 12th, 2000, 05:05 PM
#4
Thread Starter
Lively Member
Thanks a lot Glacius and Dim. I will try both of your suggestions.
Dim:
Why does the Winsock method only work sometimes?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|