'下载 Private Sub Command1_Click() Dim b() As Byte Dim strURL As String strURL = "http://www.csdn.net/images/homeimage/xxxcsdn.gif" b() = Inet1.OpenURL(strURL, icByteArray) Open "c:\csdn.gif" For Binary Access _ Write As #1 Put #1, , b() Close #1 End Sub'上传,参看如下例子 http://www.dapha.net/down/list.asp?id=1012
下载文件 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() URLDownloadToFile 0, "http://office.9zp.com/index.asp", "c:\test.txt", 0, 0 End Sub
或者用IE来下载文件 Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long Private Sub Command1_Click()
Private Sub Command1_Click()
Dim b() As Byte
Dim strURL As String
strURL = "http://www.csdn.net/images/homeimage/xxxcsdn.gif"
b() = Inet1.OpenURL(strURL, icByteArray)
Open "c:\csdn.gif" For Binary Access _
Write As #1
Put #1, , b()
Close #1
End Sub'上传,参看如下例子
http://www.dapha.net/down/list.asp?id=1012
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()
URLDownloadToFile 0, "http://office.9zp.com/index.asp", "c:\test.txt", 0, 0
End Sub
Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long
Private Sub Command1_Click()
Dim sDownload As String
sDownload = StrConv(Text1.Text, vbUnicode)
Call DoFileDownload(sDownload)
End SubPrivate Sub Form_Load()
Text1.Text = "http://www.chat.ru/~softdaily/fo-ag162.zip"
Form1.Caption = "Audiograbber 1.62 Full"
Text2.Text = "http://www6.50megs.com/audiograbber/demos/cr-ag161.zip"
End Sub上传建议使用组件,通过web页面
http://www.ourfly.com/bbs/dispbbs.asp?boardID=4&ID=150利用AspcnUP.dll组件进行文件上传
提供组件源码(vb写的),有丰富的例程,比较不错