1 private bool UrlExistsUsingHttpWebRequest( string url)
2 {
3 try
4 {
5 System.Net.HttpWebRequest myRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
6 myRequest.Method = " HEAD " ;
7 myRequest.Timeout = 100 ;
8 System.Net.HttpWebResponse res = (System.Net.HttpWebResponse)myRequest.GetResponse();
9 return (res.StatusCode == System.Net.HttpStatusCode.OK);
10 }
11 catch (System.Net.WebException we)
12 {
13 System.Diagnostics.Trace.Write(we.Message);
14 return false ;
15 }
16