如何取得ftp server上的文件的大小?
解决方案 »
- 自定义控件如何让它在运行时不显示出来
- 100分求救:如何向预先定义好的WORD模板传递参数呢??
- 如何把过程绑定到控件的事件
- 在线等待,小弟想问一下VBSP6比VBSP5增加了哪些东西,谢谢!
- 怎么实现在combo中选择地区名而另一个combo中出现对应城市的功能??
- vb怎样编程删除指定cookie或全部cookie
- 语法错语
- 紧急求问?vb数据库编程(引用ado)打开(connection)连接的时候报告没有可安装的ISAM,是什么原因?
- 面向对象的定义?
- 神哪。救救我把。。。。。。十万火急!!!!!!!!!!!!!!!!!!
- SHFileOperation函数拷贝文件时~如何得知操作是否成功或者失败?
- 中断响应
加入Inet控件Name为ITC
Private Sub cmdSize_Click()
'If the itc is ready then get the size
If ITCReady(True) Then
RecievingSize = True
ITC.Execute , "SIZE " & Chr(34) & lstRemoteFile.Text & Chr(34)
Do Until ITCReady(False)
DoEvents: DoEvents: DoEvents: DoEvents
Loop
lblStatus = "Connected"
RecievingSize = False
End If
End SubPrivate Function ITCReady(ShowMessage As Boolean)
'Check the state of itc, if it is not executing return true
If ITC.StillExecuting Then
ITCReady = False
If ShowMessage Then
MsgBox "Please wait. FTP is still executing", vbInformation + vbOKOnly, "Busy"
End If
Else
ITCReady = True
End If
End Function
==天下本无事,庸人自扰之==
得意淡然,失意泰然
[email protected]
使用 FtpFindFirstFile,InternetFindNextFile(hFile, udtWFD)获取文件信息
Dim hFile As Long, udtWFD As WIN32_FIND_DATA
hFile = FtpFindFirstFile(server, adr, udtWFD, INTERNET_FLAG_RELOAD Or INTERNET_FLAG_NO_CACHE_WRITE, 0&)文件的尺寸就是
Format((udtWFD.nFileSizeLow / 1024), "### ### ###.##")==天下本无事,庸人自扰之==
得意淡然,失意泰然
[email protected]
FileSize = frmTmp.Inet1.GetChunk(1024)