Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Check internet connction not internal network connection

john_zakariajohn_zakaria Posts: 9Member
i am making an application that must check before running the internet connection

i am using this code

try
{

req = (HttpWebRequest)WebRequest.Create("http://www.1aeg.net");
resp = (HttpWebResponse)req.GetResponse();

if (resp.StatusCode.ToString().Equals("OK"))
{
connected_check = "1";
}
else
{
connected_check = "2";
}
}
catch (Exception exc)
{
connected_check = "2";
}




when i logged out from the server the internet connection will be disabled but the internal network in the office is still connected.



when i logged off or i did not enters the user name and password the internet access is not available but the internal network is available through the server.


how i can detect if the internet access is available regardless the internal network connection in the office????
Sign In or Register to comment.