I searched alot for an answer to this question but no luck.
I want to know if I am connected to the internet or not, I may be connected from another computer (lan).
Some of the answer they gave me:
-Ping website
its not good since my program is going to check for internet connection every sec, and using batch wont be good then
-API --> GetConnectionStat / InternetConnectionEx / IsConnected
all these are telling me that I am connected to the net when I am only connected to the network
I got many other answers but the codes wount be able to tell me that I am connected to the net when I am recieving connection from another PC
can u help?
thx
On Form1 create one command button and one timer.
Paste this code:
--------------------------
Private Sub Command1_Click()
frmBrowser.cboAddress.Clea
frmBrowser.cboAddress.AddI
frmBrowser.cboAddress.List
Timer1.Interval = 1000
Timer1.Tag = 1
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Load frmBrowser
frmBrowser.Hide
End Sub
Private Sub Timer1_Timer()
Timer1.Tag = Timer1.Tag + 1
If Timer1.Tag = 60 Then
Form1.Caption = "Not connected ... try again later"
Timer1.Enabled = False
Exit Sub
End If
Form1.Caption = "Waiting..."
If frmBrowser.Caption = "Google" Then
Form1.Caption = "Connected"
Timer1.Enabled = False
End If
End Sub
--------------------------
Each time you click a button, request for openning google page will be sent.
Timer will then check every second if frmBrowsers caption was changed.
If it doesn't change to "Google" in 60 seconds, then you are probably not connected. ( I think 60 sec should be more than enough to load google )