- UID
- 5502
- 精华
- 积分
- 204
- 威望
- 点
- 宅币
- 个
- 贡献
- 次
- 宅之契约
- 份
- 最后登录
- 1970-1-1
- 在线时间
- 小时
|
功能:下载组件,单个下载,批量下载,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
复制代码 |
|