Link to home
Start Free TrialLog in
Avatar of suvmitra
suvmitraFlag for India

asked on

Display "No Internet Connection"

Hi,

I am working in VB 6. I want to display a message in a textbox as "No Internet Connection" when the computer is not connected with internet or got disconnected.

The below code is only useful when your network cable is unplugged but I want something which will show Text7.text = 1 when and the moment I am logging off from my broadband / client.

Please help.
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias _
"InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, _
ByVal dwReserved As Long) As Long
Sub TestIt()
Text7.Text = InternetCheckConnection("http://www.google.com/", &H1, 0)
End Sub

Open in new window

SOLUTION
Avatar of JackOfPH
JackOfPH
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of suvmitra

ASKER

No..I am creating the entire application into VB 6.0 only. Please help.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nope, this one is also doing the same thing.
See what I want is, IF
WebBrowser1.Navigate (http://indiangeekforum.info/)
and this particular site displays itself into the webbrowser1..THEN
Timer1.Enabled = True
 
However, what is happening there is, I am logged out from my client but as I am using a LAN connection the internet connection is still there and it is showing me as connected.
So instead, what I want is if this particular website load itself into the webrowser1 then TEXTBOX1 should display as connected and the Timer Starts.
Please help.
 
 
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial