How do I detect a connection is present to an URL or not?

Hi,
I have an application in VB.NET which has feature of determining whether a network connection is present or not.The application has certain links to other applications (in form of icons) that are present in other intranets. If network is detected it will enable the icons.
Now, I have an extra feature to add. The icons will be enabled only when network connection is present as well as I am connected to the Intranet. If I logout of the Intranet, the Icons relevant to the particular Intranet will be disabled even though I have a connection present(determined from Network Adapter)

So, is there a way to determine whether my application is connected to a particular Intranet or IP Address(supplying URL) ? I am trying to useHttpWebRequest and HttpWebResponse class for the purpose but have not succeded as yet..

Thanks in advance
Deb

[880 byte] By [Debasish] at [2008-2-2]
# 1

If you want to check if your host has been assigned a specific IP address you can do this using the System.Net.NetworkInformation namespace.
To determine if you are on a specific intranet you could try using System.Net.NetworkInformation.Ping to ping a well known host only available on the intranet. If that is successful then there is a good chance you are on the intranet you think you are. Or just try connecting to the resources you want from the intranet using Sockets/TcpClient/UdpClient. If successful, then enable the icons, if not disable them.

MikeFlasko at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2

System.Net.ServicePoint has a CurrentConnections property that you can use. Something you should keep in mind is that this property returns the number of connections actively transfering data in versions prior to V2.0, where it returns the actual number of connections in V2.0.

JonCole at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified