第一种方法:后台下载
Private Declare Function URLDownloadToFile Lib "urlmon.dll" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
URLDownloadToFile 0, "http://192.168.1.101/hbwl.rar", "c:\hbwl.rar", 0, 0
End Sub
第二种方法:文件另存为
Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long
Private Sub Command1_Click()
Dim gourl As String
gourl = StrConv("http://192.168.1.101/hbwl.rar", vbUnicode)
Call DoFileDownload(gourl)
End Sub
本文地址:https://www.xiaoyaogzs.com/3865.html
关注我们:请关注一下我们的微信公众号:扫描二维码,公众号:小姚户外
版权声明:本文为原创文章,版权归 小姚 所有,欢迎分享本文,转载请保留出处!
关注我们:请关注一下我们的微信公众号:扫描二维码,公众号:小姚户外
版权声明:本文为原创文章,版权归 小姚 所有,欢迎分享本文,转载请保留出处!
发表于2021-11-30 at 12:44 沙发
博客很棒 欢迎回访我哦
发表于2022-09-01 at 12:58 板凳
很给力!!!!!