我用INET控件写了一个FTP下载,请用如何用这个控件得到FTP空间里某一个文件的大小?我知道INET控件有个SIZE的属性可以得到大小,但是不知道具体怎么用。
解决方案 »
- access中怎样复制两表相同的内容
- 请教,在A,B表中(表结构一样ID,NAME,数据不一样),指定一个ID,先查询A表,如果数据存在则不查询B,如果A表不存在则查询B表
- 关于VB中数据库插入
- *********用什么办法使我装入的form出现在最上层?**********
- 大家对程序员出差有何看法
- VB远程访问SQL SERVER的问题
- 如何用ADO添加数据,在线等待。
- 关于image_click()和image_dblclick()的问题。
- vb与ACCESS200以上版本的兼容性问题
- EXCEL数据库
- 关于Activex控件问题
- 用REALONE写了一个播放器,如何屏蔽REALONE上的鼠标右键?
使用getchunk接收
Inet1.GetChunk(1024, 0) '0表示把数据作为字符串来检索,1表示把数据作为字节数组来检索附完整代码
Dim OperationStyle As Integer
Dim filesize As LongPrivate Sub Command1_Click() Dim StrMsg As String
Dim isbusy As Boolean
Inet1.URL = "ftp://192.168.0.1/"
Inet1.Protocol = icFTP
Inet1.UserName = ""
Inet1.Password = ""
StrMsg = "Dir"
Inet1.Execute , StrMsg
End SubPrivate Sub Command3_Click()
OperationStyle = 2
Inet1.Execute , "size wq.rar"
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"
Select Case OperationStyle
Case 2
filesize = Inet1.GetChunk(1024, 0)
MsgBox CStr(filesize)
Case Else
End Select
End Select
End Sub
你这个问题我转给online和大斑竹过大斑竹也没有环境因为他也在外地出差,online现在已经答你的了对于问题,我解决不了的,我一般会转给可能能够解答的斑竹的:)
Inet1.Protocol = icFTP
Inet1.UserName = ""
Inet1.Password = ""
这个换成你可以访问的站点,我在本机安装了ftp环境