逍遥下载组件控件OCX,DLL(单个下载,批量下载)适用VBA,VB6,易语言
功能:下载组件,单个下载,批量下载,OCX,DLL模式适合32位VB6,VBA,64位的正在开发中
使用教程视频网址:https://www.bilibili.com/video/BV1p98xzTEeq/
Option Explicit
'Dim DownListA As New HttpDownList
Dim WithEvents DownListA As HttpDownList '批量下载
Dim WithEvents Down As HttpDown
Private Sub Command1_Click()
'批量下载
Set DownListA = New HttpDownList
Dim UrlList(1) As String, CustomFileNameArrA(1) As String
UrlList(0) = "https://raw.staticdn.net/xiaoyaocode163/Webview2_win7_109List/main/Webview2Sdk.zip"
UrlList(1) = "https://raw.staticdn.net/xiaoyaocode163/Webview2_win7_109List/main/Webview2Sdk.z01"
CustomFileNameArrA(0) = "1.ZIP"
CustomFileNameArrA(1) = "2.ZIP"
DownListA.StartDownList UrlList, "", True, CustomFileNameArrA
End Sub
Private Sub Command2_Click()
'单个下载
Set Down = New HttpDown
Down.StartDown "https://raw.staticdn.net/xiaoyaocode163/Webview2_win7_109List/main/Webview2Sdk.zip", App.Path & "\test.zip"
End Sub
Private Sub Command3_Click()
'控件下载
DownOCX1.DownLoad "https://raw.staticdn.net/xiaoyaocode163/Webview2_win7_109List/main/Webview2Sdk.zip", App.Path & "\test.zip", "test.zip"
End Sub
Private Sub Command4_Click()
Set DownListA = New HttpDownList
DownListA.ShowDownForm '调用下载工具/显示窗口
End Sub
Private Sub Down_DownloadEnd(ByVal SuccessA As Boolean, ByVal Status As String)
MsgBox "单次下载完成"
End Sub
Private Sub Down_DownloadProgress(ByVal ReceivedBytes As Long, ByVal TotalBytes As Long)
'下载进度(已收到字节数,总字节数)
End Sub
Private Sub DownListA_AllDownOK()
MsgBox "DownList_AllDownOK"
End Sub
Private Sub DownListA_DownOK(ByVal Index As Long, ByVal DownCount As Long, ByVal AllCount As Long)
Debug.Print Index; "完成下载数:" & DownCount; "任务数:" & AllCount
End Sub
Private Sub DownOCX1_DownloadEnd(ByVal SuccessA As Boolean, ByVal Status As String)
MsgBox "下载完成"
End Sub
Private Sub DownOCX1_接收事件(ByVal 收到字节数 As Long, ByVal 总长度 As Long)
'
End Sub
在RING3下载东西不费事啊。。。URLDownloadToFile不就行了? 美俪女神 发表于 2025-7-27 19:56
在RING3下载东西不费事啊。。。URLDownloadToFile不就行了?
URLDownloadToFile,控件本身的异步下载都用不了,就是这么怪。
URLDownloadToFile 如遇到网络问题,会卡死
页:
[1]