用vb复制网络服务器的文件到本地硬盘

来源:百度知道 编辑:UC知道 时间:2024/09/21 07:02:07
如何用vb复制指定的http服务器中的文件到本地硬盘
比如:复制http://www.xxx.com/1.exe到C盘?
最好有源代码,压成rar或zip发到我的邮箱
inuyashazaq@126.com
或者说明详细过程
谢谢了
验证可以用后再加80分

画面添加CommonDialog Command1 Text1
'CommonDialog起名CDialog
'Text1里就写你要下载的文件的路径!~

你再用filecopy 到c盘就可以了 如果不会传消息吧!~

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 Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
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
End Function

Private Sub Command1_Click()
Dim sPath As String
Dim sFile As String
Dim bBool As Boolean

If F_bDialogShow(CDialog, sFile, 0) = False Then
Cmd