【问题标题】:VB.net loading out of date webpagesVB.net 加载过时的网页
【发布时间】:2014-07-08 00:38:56
【问题描述】:

我使用以下代码从列出的网站中复制某行文本。

    'Track A
    Dim TrackA As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://pilotweb.nas.faa.gov/common/nat.html")
    Dim GaA As System.Net.HttpWebResponse = TrackA.GetResponse
    Dim WrA As System.IO.StreamReader = New System.IO.StreamReader(GaA.GetResponseStream)
    Dim ContentStrA As String = WrA.ReadToEnd
    Dim StartIndexA As Integer = ContentStrA.IndexOf(vbLf & "A ") + 1
    Dim StrLengthA As Integer = ContentStrA.IndexOf(vbLf, StartIndexA) - StartIndexA

但是,当我在 VB 的选项卡中打开链接时,它会显示几天前的网站版本,由于我需要当前版本的网站,如何防止这种情况发生?

【问题讨论】:

    标签: vb.net


    【解决方案1】:

    更改System.Net.HttpWebRequest 对象的Cache Policy,这样您就不会获得缓存结果。

    您也可以clear the cache for your URL

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-12-09
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多