Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created November 16, 2010 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaisbetts/702087 to your computer and use it in GitHub Desktop.
Save anaisbetts/702087 to your computer and use it in GitHub Desktop.
private static bool ValidateUri(string Uri)
{
try
{
var request = WebRequest.Create(Uri) as HttpWebRequest;
var response = request.GetResponse() as HttpWebResponse;
return (response.StatusCode == HttpStatusCode.OK);
}
catch
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment