找回密码
 加入
搜索
查看: 10189|回复: 15

[AU3基础] 如何判断下载文件完成

 火.. [复制链接]
发表于 2012-9-10 21:23:36 | 显示全部楼层 |阅读模式
在网页上面下载文件,如何判断下载文件完成,以便执行下一步的操作.
发表于 2012-9-10 22:36:38 | 显示全部楼层
问题太模糊了。是用什么下载?InetGet函数?还是浏览器自带的下载功能?还是迅雷等下载软件?还是别的?这些都有不同的判断方式。
发表于 2012-9-11 06:24:40 | 显示全部楼层
回复 1# sex123

如果是IE浏览器里用InetGet函数,请参考InetGetInfo帮助信息
 楼主| 发表于 2012-9-11 09:49:42 | 显示全部楼层
问题太模糊了。是用什么下载?InetGet函数?还是浏览器自带的下载功能?还是迅雷等下载软件?还是别的?这些 ...
ajian55 发表于 2012-9-10 22:36



     是browser自带下载功能,我用IE和FIREFOX
发表于 2012-9-11 19:19:18 | 显示全部楼层
用InetGet函数试一下啊
发表于 2012-9-17 10:49:22 | 显示全部楼层
本帖最后由 piaoa_998 于 2012-9-17 13:59 编辑

$file = InetGet("URL")
$size = InetGetSize ( "URL" )返回你要下载的文件的size,然后和你正在下的文件做对比

$data = FileGetSize ( "filename" )

while 1
   if $size = $data then
      exitloop
   endif
wend
发表于 2012-9-17 11:13:01 | 显示全部楼层
对,将文件的大小对比,只要一样就表示下载完成了
发表于 2012-9-17 11:13:06 | 显示全部楼层
对,将文件的大小对比,只要一样就表示下载完成了
 楼主| 发表于 2012-9-17 20:56:07 | 显示全部楼层
$file = InetGet("URL")
$size = InetGetSize ( "URL" )返回你要下载的文件的size,然后和你正在下的文件做 ...
piaoa_998 发表于 2012-9-17 10:49



    有时下载文件大小或长度不知.
发表于 2012-9-17 21:23:17 | 显示全部楼层
最简单就是进行文件对比了
发表于 2012-9-19 11:31:34 | 显示全部楼层
本帖最后由 piaoa_998 于 2012-9-19 11:36 编辑

可以用另一种方法
        Local $RtDownload = InetGet($strRemotePath,$strLocalPath,1,1)
       
        Do
                Sleep(1000)
                If $RtDownload = 0 Then
                consolewrite("DownLoadPackage : $RtDownload = " & $RtDownload & "$strLocalPath = " & $strLocalPath)
                Return False
               EndIf
        consolewrite("@InetGetBytesRead = "&@InetGetBytesRead)
        Until @InetGetActive = 0 Or @InetGetBytesRead = -1 判断直到这两个宏条件成立
发表于 2012-9-24 00:06:19 | 显示全部楼层
回复 12# piaoa_998


   你这个是旧的吧???

看帮助文档

InetGet("abort"), @InetGetActive and @InetGetBytesRead have been removed. The following list shows the new functions used to access the old behavior:
InetGet("abort") - Calling the new InetClose() function with a handle returned from InetGet() will abort a download.
@InetGetActive - Calling the new InetGetInfo() function with no parameters returns a count of active downloads.
@InetGetBytesRead - Calling the new InetGetInfo() function with a handle returned from InetGet()will return the bytes read (and more) for a download.
发表于 2012-9-26 14:53:17 | 显示全部楼层
呵呵 是的 宏被函数代替了
Until InetGetInfo($RtDownload, 2)
发表于 2012-10-6 12:57:58 | 显示全部楼层
未下载完成之前,文件的名称也可以看出来吧,通过读取文件名称作比对可靠吗?
发表于 2012-10-9 18:38:33 | 显示全部楼层

支持!很不错啊,支持

呵呵。。。。。


















最好的孕妇防辐射服
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-20 03:11 , Processed in 0.099665 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表