From 64540507f42a738d94aa7dfdba12f43b6df6580b Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 28 Jul 2020 19:20:09 +0800 Subject: [PATCH] fix visual's check-update --- src/visual/Module_update.bas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/visual/Module_update.bas b/src/visual/Module_update.bas index db51991..06bb49c 100644 --- a/src/visual/Module_update.bas +++ b/src/visual/Module_update.bas @@ -1,6 +1,7 @@ Attribute VB_Name = "Module_update" Option Explicit -Private 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 +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 +Public Declare Function DeleteUrlCacheEntry Lib "wininet" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long Dim update_version As String Dim update_file_name As String Dim update_url As String @@ -53,6 +54,7 @@ Public Sub Delete_file(file_name As String) ' 删 End If End Sub Public Function Download_file(url As String, file_name As String) As Boolean ' 下载文件 成功返回true 错误返回false + Call DeleteUrlCacheEntry(url) If URLDownloadToFile(0, url, file_name, 0, 0) = 0 Then Download_file = True Else