|
楼主 |
发表于 2023-3-6 08:11
|
显示全部楼层
我在网上找到了一段代码,已经可以下载文件了,但URL网址,每次下载都变动,所以导致每次下载都是同一个内容的文件,而不是最新的文件,有办法固定URL网址吗?
以下是下载的代码
Private Declare PtrSafe 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 '申明API
Sub downlaod()
URLDownloadToFile 0, "https://weboffice.ks3-cn-beijing.ksyun.com/tmp/exportfiles/219932587567/ce7fdd354ed940676143b327e5b1e23b?Expires=1677931241&KSSAccessKeyId=AKLTzxVrVoSpSCudfbEDNDRSUQ&Signature=bcMAKYFThzytwJWvEZ1F%2F0lMez8%3D&response-content-disposition=attachment%3Bfilename%2A%3DUTF-8%27%27%25E6%25B5%258B%25E8%25AF%25952.xlsx", "d:\data\28.xlsx", 0, 0
End Sub |
|