读取FtpGetFile返回值问题,奇怪

shien 2005-05-24 12:10:40
Public Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _
(ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _
ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, ByVal dwFlagsAndAttributes As Long, _
ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean


程序中调用了API的FtpGetFile函数

dim isFlag as boolean
isFlag=FtpGetFile (....)
if not isFlag then
.....
end if

单步执行发现isFlag的值为False, 但是就是不能进入
if not isFlag then
.....
end if

后来把判断改为 if isFlag=false then 才正常了几天
现在又不行了,只有改写为if cstr(isFlag)="False" then





...全文
181 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
bugxiong 2005-09-07
  • 打赏
  • 举报
回复
' 下载文件
strFileLocal = "c:\ftpTest.rar"
strFileRemote = "ftpTest.rar"
bRet = FtpGetFile(hConnection, strFileRemote, strFileLocal, False, _
INTERNET_FLAG_RELOAD, dwType, 0)
If bRet = False Then
ErrorOut Err.LastDllError, "FtpGetFile"
GoTo Exit_Sub
End If
bugxiong 2005-09-06
  • 打赏
  • 举报
回复
现在插入到872117条数据了
shien 2005-05-25
  • 打赏
  • 举报
回复
谢谢兔子,俺就是按照这个文章介绍写的,
但是文章中这段代码
blnRC = FtpGetFile(lnginetconn, "website/address.asp", "c:\address.asp", 0, 0, 1, 0)
If blnRC Then
MsgBox "download ok!!!"
End If

在我的机器里执行有问题,必须将
If blnRC Then 写成 if cstr(bInrc)='true'
  • 打赏
  • 举报
回复
http;//blog.csdn.net/liuxiaoyi666 有一篇ftp实现上传下载
shien 2005-05-25
  • 打赏
  • 举报
回复
有人帮忙吗
shien 2005-05-24
  • 打赏
  • 举报
回复
连接在程序前面已经建立好了
DooDu 2005-05-24
  • 打赏
  • 举报
回复
这个api用前要先建立连接吧?

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧