![]() |
Test User's Internet Connection in VB
1 Attachment(s)
As more and more of your applications become distributed across the Internet, you'll no doubt want to build in a way to determine if the current user is actually connected to the Web. Fortunately, the Windows API offers a quick and easy way to do so with the InternetGetConnectedState() function.
This function uses the declaration syntax seen here: Code: VB
Code: VB
To see how this function works, launch a new VB project, and drop a Command Button onto the default form. Right-click on the form and select View Code from the shortcut menu. When the IDE opens the Code window, enter the InternetGetConnectedState() function and constant declarations as shown above. Then, enter the following procedures: Code: VB
|
Re: Test User's Internet Connection in VB
dear friends
this code is realy great i thanks to mr pradeep lots. sujay kumar |
Re: Test User's Internet Connection in VB
Welcome sujay!
Happy programming! |
Re: Test User's Internet Connection in VB
Dear Sir,
This code is great but can I make this connection for example to get data from our server for instance? thanks more power and regards. |
Re: Test User's Internet Connection in VB
For that purpose you'll need to use Winsock!
|
Re: Test User's Internet Connection in VB
winsock I never used that control yet can you make a simple code for me or how can i access that control and how can i use it? thanks for your reply and regards.
|
Re: Test User's Internet Connection in VB
Nice one.
|
Re: Test User's Internet Connection in VB
An easy way is with Internet Get Connected State() function.As more and more of your applications become distributed across the Internet, you'll no doubt want to build in a way to determine if the current user is actually connected to the Web. Fortunately, the Windows API offers a quick and easy way to do so with the InternetGetConnectedState() function.
|
Re: Test User's Internet Connection in VB
Hi Pradeep,
I tried your script, but would you be able to help me out with a VBS for testing the Internet access to a specifc URL using a proxy ? Like the http.open method along with response and setproxy functions..... Thanks.... |
Re: Test User's Internet Connection in VB
Hello,
I'm kinda new in VB6.0 and I'm trying to make a program that can indicate whether a computer is connected to a LAN or not at all times. Can anyone help? Thanks!!! |
Re: Test User's Internet Connection in VB
Thats a really great. Thanks a lot for that...............
|
Re: Test User's Internet Connection in VB
dear friend's
i'am new programmer invisual basic. I like vb programming. i Think it's easy to connecting for Internet. |
Re: Test User's Internet Connection in VB
Hello,
Its Very Very Nice Code. Thanks. |
Re: Test User's Internet Connection in VB
thanks, that's what I was looking for.
|
Re: Test User's Internet Connection in VB
nice article
:2thumbsup |
Re: Test User's Internet Connection in VB
:(I have follow your instruction to run the program, but the vb 2005 complaint variable 'msg' is passed by reference before it has been assigned a value. a null reference exception could result at runtime, which this line of code
If IsWebConnected(msg) Then |
Re: Test User's Internet Connection in VB
how to run this program??
|
| All times are GMT +5.5. The time now is 03:50. |