Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On Line?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00580434
Message ID:
00580483
Views:
26
>Hi!
>
>>How do I know programately if I'm connected to the Internet. Any Ocx?
>
>#define INTERNET_CONNECTION_MODEM           1
>#define INTERNET_CONNECTION_LAN             2
>#define INTERNET_CONNECTION_PROXY           4
>#define INTERNET_CONNECTION_MODEM_BUSY      8
>
>Declare Integer InternetGetConnectedState in Wininet.dll Long @dwFlags, Long Reserved
>
>Flags = 0
>Msg = ""
>If InternetGetConnectedState(@Flags, 0) != 0
>	Do Case
>	Case BitAnd(Flags, INTERNET_CONNECTION_MODEM) > 0
>		Msg = "Connection via modem"
>	Case BitAnd(Flags, INTERNET_CONNECTION_LAN) > 0
>		Msg = "Connection via LAN"
>	EndCase
>Else
>	Msg = "Not connected"
>EndIf
>MessageBox(msg)
>
THis is unreliable with a proxy, since AFA the machine is concerned, if it can reach the proxy server, it can reach the Internet. A better way is to ping a known IP address outside your gateway.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform