Checking for client internet connection. 
Author Message
 Checking for client internet connection.

Can anyone show me how to check if the client has a live internet
connection, in VB.net

Thanks all.



Sat, 17 Jul 2004 00:46:06 GMT  
 Checking for client internet connection.
If you are trying to figure out if a client can access a certain Web Site,
then the easiest method might be to try pinging that web site using classes
in the System.Net namespace or just try to open a web site.  The code would
simply be:

            Dim result As WebResponse
            Dim req As WebRequest

            req = WebRequest.Create("http://www.mysite.com")
            result = req.GetResponse()

            ' Then test the result to see if you got what you wanted.....

Matthew Arnheiter


Quote:
> Can anyone show me how to check if the client has a live internet
> connection, in VB.net



Sat, 17 Jul 2004 08:22:36 GMT  
 Checking for client internet connection.
Sounds good I did come up with a few similar solutions including an error
trapping routine.  But I was wondering if there was some deliberate
isConnected method or the like that would tell me if the client has a live
internet connection before I invoke a web service or any functionality that
would require the client to be live.  Any ideas?
I hope this Q is not to silly I'm used to dealing with applications that run
from with in a browser but in this case there would be a desktop application
that would access the internet i.e:(webservices), etc.. and I can't assume a
live connection by default.

Thanks again, very appreciated,
John.

Quote:
> If you are trying to figure out if a client can access a certain Web Site,
> then the easiest method might be to try pinging that web site using
classes
> in the System.Net namespace or just try to open a web site.  The code
would
> simply be:

>             Dim result As WebResponse
>             Dim req As WebRequest

>             req = WebRequest.Create("http://www.mysite.com")
>             result = req.GetResponse()

>             ' Then test the result to see if you got what you wanted.....

> Matthew Arnheiter



> > Can anyone show me how to check if the client has a live internet
> > connection, in VB.net



Sat, 17 Jul 2004 10:34:10 GMT  
 Checking for client internet connection.
You can mimic the model that IE uses when starting.  IE caches some
information that you configure in their setup wizard (what type of
connection - dial-up or lan, what dial up connection, or what proxy,etc.).
Last I knew, this information was stored in the registry.  Then when you
open IE, if it is a dial-up connection it tests to see if that network
connection is active or not, otherwise, if it was a LAN connection it just
tries to hit the web site and you either connect or don't.  I have not
looked to see if you can gain access of the network connection through the
.NET class library, but that would be one way to go if it was a dial-up
connection.  If it is just a LAN connection, the best you can do is try and
handle the errors.


Quote:
> Sounds good I did come up with a few similar solutions including an error
> trapping routine.  But I was wondering if there was some deliberate
> isConnected method or the like that would tell me if the client has a live
> internet connection before I invoke a web service or any functionality
that
> would require the client to be live.  Any ideas?



Sun, 18 Jul 2004 01:45:04 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Internet Client Error: Connection Reset

2. checking internet connection from .net

3. Check Internet Connection

4. Advanced: CHECK for Internet Connection

5. Checking an Internet Connection

6. Checking for active internet connection.

7. Check Internet Connection

8. Check for internet connection

9. Checking an Internet Connection

10. Checking for Internet connection

11. checking for internet connection in NT

12. How to check for internet connection?

 

 
Powered by phpBB® Forum Software