Apologies I entered some dummy values and forgot to append http:// to
the URL.

Not sure about the unable to connect to remote server. I receive a 200
or OK response regrdless of the validity of the URL


On 15 Dec, 14:41, Jamie Fraser <[email protected]> wrote:
> 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