I'm not seeing that behaviour.

If I run your code, I get an error due to the URI being malformed.

If I use a valid, but non-existent URI, I get the error "Unable to connect
to the remote server".

On Tue, Dec 15, 2009 at 11:59 AM, hanks2000 <[email protected]>wrote:

> Hi All
>
> I'm using the following code to validate and verify a URL exists.  The
> problem I'm getting is a status code 200 (OK) is always returned,
> regardless of the entered URL. Does anybody have any ideas why?  I
> have a feeling its something to do with the proxy I need to use but
> cannot see why this would result in 200 status code being returned
>
> Thank You in advance
>
> Hanks
>
>            wProxy = New WebProxy(strProxy)
>            wProxy.Credentials = New System.Net.NetworkCredential
> (strUser, strPassword, strDomain)
>
>            httpReq = CType(WebRequest.Create
> ("wontwork6763433446778"), HttpWebRequest)
>            httpReq.Proxy = CType(wProxy, IWebProxy)
>
>            httpResp = CType(httpReq.GetResponse, HttpWebResponse)
>
>            If httpResp.StatusCode = HttpStatusCode.OK Then
>                Return True
>            Else
>                Return False
>            End If
>

Reply via email to