清晰的Internet缓存vb6.0

问题描述 投票:0回答:1

当我下载文本文件以读取内容时,下一次我没有得到文件更改后的内容。以某种方式读取缓存文件,而不是Internet站点上的更新文件。下载并读取文件后,是否可以直接从缓存中删除特定文件?

'API used:

Public Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

'Internet Read Text File Content
If FileExists(FileToCreate) = True Then
  Kill (FileToCreate) ' kill it to make sure it is created by this routine
End If

If INetThere = True Then ' checks if there is an Internet connection

On Error Resume Next ' Issue with Digital Certification, to be resolved later.
    BaK = URLDownloadToFile(0, FileToGet, FileToCreate, 0, 0)
On Error GoTo 0
    If Err.Number <> 0 Then MsgBox (Err.Number)
End If

If FileExists(FileToCreate) Then ' get content: CACHE problem, reads old file from memory instead of Internet file content
    VrijeFile = FreeFile
    Open FileToCreate For Input As #VrijeFile
    Line Input #VrijeFile, VersionBAK ' this line gets the data from the old, previously read file in chache
    Close #VrijeFile
    Kill (FileToCreate)
End If

If VersionBAK <> "" Then
  LeesRegeL = VersionBAK
  UpdateMajor = VBA.Val(VBA.Trim$(Chop_On(vbDot)))
  UpdateMinor = VBA.Val(VBA.Trim$(Chop_On(vbDot)))
  UpdateRevision = VBA.Val(VBA.Trim$(LeesRegeL))
End If

New_LCWin_Version = (UpdateMajor > LCWinMajoR) Or (UpdateMinor > LCWinMinoR) Or (UpdateRevision > LCWinReviSioN)

CheckForUpdate = New_LCWin_Version ' end result for the function returned
caching vb6 browser-cache
1个回答
0
投票

问题已解决:

[该文件未由Internet提供商公开,尽管我可以查看文件的新内容,但该文件不公开,旧文件则公开。

因此不是未更新的缓存,而是网站本身。

感谢您的观看和贡献。

案例已结案,希望对其他人有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.