Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet Connection
Message
From
12/08/2002 14:31:45
 
 
To
12/08/2002 14:23:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00688602
Message ID:
00688763
Views:
32
Thanks for the example Steve. I was pinging an ip address, piping the results to a text file, and then using filetostr to parse it and look for 'unknown host.' It works, but I like your solution better.

Tracy

>Jos,
>
>Here is an example:
>
>
>procedure checkInternetConnection
>
>	local lcWebAddress
>	lcWebAddress = "http://mail.airmail.net"  && change this to a web address located close
>							&& to you
>
>	* lcWebAddress = "http://206.66.12.86"    && or you can hard code the IP address
>	                                              && of a web server
>
>	Declare Integer InternetCheckConnection in Wininet.dll String Url, Long dwFlags, Long Reserved
>
>	If InternetCheckConnection(lcWebAddress, 1, 0) != 0
>		return .t.
>	Else
>		return .f.
>	EndIf
>
>endproc
>
>>Hi Tracy
>>
>>Thanks for this feedback. Can you give an example of the ping etc?
>>
>>TIA
>>
>>Jos
>>
>>
>>>I have not found a complete solution yet though. So what I am doing is using the same function you do first to determine if a connection is configured, and then I ping a known server that is up 24 hours a day. If that is not reached I ping another system through a different route. If I cannot reach either, then I assume the connection is down. This only works if you have an ip address you know should always be reachable though. I guess they could try to reach the required system and if unsuccessful, you'd know its down. I'd like a single solution instead.
>>>
>>>Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform