How about setting the TimeOut property on your WebRequest?
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Alfa & Omega" wrote:
> I found this example but when it comes to:
>
> Resp = WebReq.GetResponse();
>
> It jus freezes my application??
>
> <CODE>
> public static bool IsConnected()
> {
> System.Uri Url = new System.Uri("http://www.microsoft.com");
>
> System.Net.WebRequest WebReq;
> System.Net.WebResponse Resp;
> WebReq = System.Net.WebRequest.Create(Url);
>
> try
> {
> Resp = WebReq.GetResponse();
> Resp.Close();
> WebReq = null;
> return true;
> }
>
> catch
> {
> WebReq = null;
> return false;
> }
> }</CODE>
>
>
>