Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Testing Internet connection?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sprungli - 24 Sep 2004 19:26 GMT
In a Library or Win Forms application how can my code test whether the
computer is connected to the Internet? (The computer could use a dial-up
connection or it could be on a network.)

TIA
Sijin Joseph - 26 Sep 2004 16:10 GMT
There are two ways you can do that, one is to simply try and make a web
request to a known url and catch the exception that would occur when
there is no internet connection, this method is detailed here

http://www.code101.com/Code101/DisplayArticle.aspx?cid=77

and here

http://www.developerfusion.com/show/3903/

secondly, you can use the InternetGetConnectedState() API from
WinInet.dll, this method is detailed here

http://www.vbip.com/wininet/wininet_dialup.asp

and here

http://vbnet.mvps.org/index.html?code/network/internetgetconnectedstate.htm

Hope that helps.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> In a Library or Win Forms application how can my code test whether the
> computer is connected to the Internet? (The computer could use a dial-up
> connection or it could be on a network.)
>
> TIA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.