views:

72

answers:

2

I already know how to check if there's a connection to the internet. But I want this(function) to be called when the user plugs a lan line in or connect to a wifi network. Basically am creating a Auto-Login for my university.

+1  A: 

I suppose you can have a listener thread which will simply check status of internet connection and raise event if connection appeared or lost.

Alex Krupnov
+2  A: 

By far the easiest method is to simply attempt to periodically run the standard auto login procedure, if it works all is well and the user is logged in if it does not then there is no connection. There is little point trying to determine WHY there is no connection unless you are writitng some kind network connectivity diagnostic app.

Ben Robinson