请问如何用windows api 实现文件的上传与下载(http)?谢谢了!
解决方案 »
- 如何判断摄像头是否已捕获到呢?
- WINSOCK仿post方式上传图片,8K以下的才能成功
- 关于 C1.Win.C1Input.C1NumericEdit 的问题
- vb报表打印问题
- 快结婚了,未婚妻最喜欢白金首饰,可老妈喜欢黄金的,执意给儿媳妇买黄金的,我在她们中间沟通过很多次,没用,我该怎么办,都头疼
- 如何设置进程优先级???高手一定要进!!
- 如何把string类型转换为money
- 在listView1中建立两个列首:"名称"和"内容"如何实现"内容"下的选项(如小明)可以通过鼠标双击来激活修改!(像Excel 那样往里填数据,双击
- 想在安装程序的时候把程序信息写入注册表,该如何写??
- 自制ActiveX插入网页让访问者自动下载时出了点问题。请教各位前辈!高分相送!
- vb怎样导access数据到word? 数据库里面有二进制图片,想把图片也导到word? 急!!!!
- 关于带密码的数据库的操作
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上传需要知道服务器允许怎么上传
http://www.ourfly.com/bbs/dispbbs.asp?boardID=4&ID=150利用AspcnUP.dll组件进行文件上传
提供组件源码(vb写的),有丰富的例程,比较不错
Dim isbusy As Boolean
Inet1.URL = "ftp://www.xxx.com/"
Inet1.Protocol = icFTP
Inet1.UserName = "oxx"
Inet1.Password = "xxx"
StrMsg = "Dir"
Inet1.Execute , StrMsg
End SubPrivate Sub Command2_Click()
On Error GoTo errhandle:
Dim s1 As String
Inet1.Execute , "Get 2.zip C:\234.zip"
Do While isbusy
isbusy = Inet1.StillExecuting
DoEvents
Loop
errhandle:
MsgBox Err.Description
End SubPrivate Sub Inet1_StateChanged(ByVal State As Integer)
Select Case State
Case 1
Text1.Text = "is looking"
Case 2
Text1.Text = "success finding "
Case 3
Text1.Text = "is connecting"
Case 4
Text1.Text = "success connected"
Case 5
Text1.Text = "is sending request"
Case 6
Text1.Text = "sucess sending"
Case 7
Text1.Text = "is receiving"
Case 8
Text1.Text = "success receive"
Case 9
Text1.Text = "is disconnecting"
Case 10
Text1.Text = "success disconnect"
Case 11
Text1.Text = "is error"
Case 12 'icResponseCompleted
Text1.Text = "success receive data"
bDowning = False
End Select
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