找回密码
 加入
搜索
查看: 3041|回复: 3

[AU3基础] (已解).关于就版本@InetGetBytesRead函数用新版InetGetInfo替换问题.

[复制链接]
发表于 2010-3-7 23:56:06 | 显示全部楼层 |阅读模式
本帖最后由 夜猫猫 于 2010-3-8 22:55 编辑

问题如题,求解.原代码跟<破帽遮颜> 的自动更新程序源码差不多,
http://www.autoitx.com/viewthrea ... hlight=%B8%FC%D0%C2

其中一段代码
        While @InetGetActive
                $DnPercent = Int(@InetGetBytesRead / $upd_Size * 100)
                $DnBytes = Round(@InetGetBytesRead / 1024) & ' KB'
                $DnSize = Round($upd_Size / 1024) & ' KB'
                GUICtrlSetData($Progress1, $DnPercent)
                GUICtrlSetData($Input3, $DnSize & " / " & $DnPercent & "%")
                TrayTip("更新情况:", "更新进度:" & $DnPercent & "% (当前更新:" & $DnBytes & "/文件大小:" & $DnSize & ")", 1)
                Sleep(250)
        WEnd

替换为下面代码.主要是不能获取下载速度.
Local $aData = InetGetInfo(InetGet($Down, $Disk & "\" & $Name, 1, 1))
                $DnPercent = Int($aData[0] / $upd_Size * 100)
                $DnBytes = Round($aData[1] / 1024) & ' KB'
                $DnSize = Round($upd_Size / 1024) & ' KB'
                GUICtrlSetData($Progress1, $DnPercent)
                GUICtrlSetData($Input3, $DnSize & " / " & $DnPercent & "%")
                TrayTip("更新情况:", "更新进度:" & $DnPercent & "% (当前更新:" & $DnBytes & "/文件大小:" & $DnSize & ")", 1)
                Sleep(250)

还请那位TX能帮忙下,最好能有个列子。

在此先谢谢各位。。

菜鸟真不好当啊!
发表于 2010-3-8 00:02:08 | 显示全部楼层
循环没
发表于 2010-7-31 14:09:07 | 显示全部楼层
请问你是如何解决的啊?
发表于 2011-4-23 01:48:28 | 显示全部楼层
为什么解决了 不把解决方法发出来呢??新手真的很无奈的!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 08:39 , Processed in 0.076780 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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