WebClient()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yet Another One

    #1

    WebClient()

    Hello,


    I am using System.Net.WebC lient() to download a web page. This works
    fine in itself, BUT... if there is no response from the web site or if
    my network is down, it NEVER times out trying to get the page. So, I
    guess I am asking if there is a way to set a timeout for the
    WebClient?

    I have looked around for this but my search is coming up empty for the
    most part. If there is no way to set a timeout for the WebClient(),
    then is there something else I can use to download the web page into
    memory and work with it from there? Currently, I use:

    Dim myWebClient As New WebClient()
    Dim theIP As String
    theIP = myWebClient.Dow nloadString("ht tp://www.foo.com/")

    I then pass the resulting downloaded string to a parser function and
    work with it from there.

    Is there another method for doing this same thing, but which includes
    an option to set a timeout?

    Many thanks in advance!

    Ryan
Working...