vb.net wRequest 循环到字符串数组中的每个链接



如果我能像这样为一个链接做WebRequest

    Dim rt As String = "http://www.somelink.com"
    Dim wRequest As WebRequest
    Dim WResponse As WebResponse
    Dim SR As StreamReader
    wRequest = FtpWebRequest.Create(rt)
    WResponse = wRequest.GetResponse
    SR = New StreamReader(WResponse.GetResponseStream)
    rt = SR.ReadToEnd

如何为链接数组或字符串数组创建WebRequest循环或函数并为我返回一个字符串或字符串数组中的每个链接WebResponse

好的,

我找到了答案

    Dim SR As StreamReader
For i As Int32 = 0 To myarr.Length - 1
    Dim wRequest As WebRequest
    Dim WResponse As WebResponse
    wRequest = FtpWebRequest.Create(myarr(i))
    WResponse = wRequest.GetResponse
    SR = New StreamReader(WResponse.GetResponseStream)
    myarr(i) = SR.ReadToEnd
Next

相关内容

  • 没有找到相关文章

最新更新