One word of warning; InternetGetConnectedState is easily confused and can
report an internet connection when there isn't one. It's a good first
check, but you need to do more.
In my old VB6 apps, I use InternetGetConnectedState to make the first
check and, if it reports that there is an internet connection, I attempt
to connect to a known FTP site (our company web site, actually) and only
if that connection can be established do I take it as proof that there is
an internet connection.
Steve
Peter Bromberg said:
Nothing built in other than attempting a download via HttpWebRequest.
However, with an API, its easy:
[DllImport(@"C:\Windows\System32\wininet.dll")]
// this method will check the internet connection state
public static extern bool InternetGetConnectedState(ref uint connected,
uint
reserved);
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
Dennis C. Drumm said:
Does .net Framework 2.0 have anything new to help us detect if a user
has an
active internet connection and to send a notice when a connection is
established or dropped?
Thanks,
Dennis