vb编写一个text1输入地址 点击command1 下载 text2为 贮存地址
4个回答
展开全部
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 Command1_Click
R = URLDownloadToFile(0, Text1.Text, Text2.Text,0, 0)
End Sub
Private Sub Command1_Click
R = URLDownloadToFile(0, Text1.Text, Text2.Text,0, 0)
End Sub
追问
无效
追答
有效 自己去好好看去
展开全部
~~~~~~~~~~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Option Explicit
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 Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000
Public Function DownloadFile(sSourceUrl As String, sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, sSourceUrl, sLocalFile, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
End Function
Private Sub Command1_Click()
Dim sSourceUrl As String
Dim sLocalFile As String
sSourceUrl = Text1.Text
sLocalFile = Text2.Text
If DownloadFile(sSourceUrl, sLocalFile) Then
MsgBox "下载成功"
End If
End Sub
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 Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000
Public Function DownloadFile(sSourceUrl As String, sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, sSourceUrl, sLocalFile, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
End Function
Private Sub Command1_Click()
Dim sSourceUrl As String
Dim sLocalFile As String
sSourceUrl = Text1.Text
sLocalFile = Text2.Text
If DownloadFile(sSourceUrl, sLocalFile) Then
MsgBox "下载成功"
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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 Command1_Click
R = URLDownloadToFile(0, Text1.Text, Text2.Text,0, 0)
End Sub
吾来刷分
Private Sub Command1_Click
R = URLDownloadToFile(0, Text1.Text, Text2.Text,0, 0)
End Sub
吾来刷分
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询