这是我再次修正
FileDelete("Temp.ini") ;删除一个或多个文件.
$time1_IniWrite = IniWrite ( "Temp.ini", "time", "time1", @HOUR & @MIN & @SEC ) ;向某标准配置文件(*.ini)中写入某个数值.
$URL = "http://vod.bsvip.net/ddvod/user/help/player/divx_for_avi/DivX521XP2K.exe"
$Customer = "DivX521XP2K.exe"
InetGet($URL , $Customer, 1, 1) ;通过HTTP或FTP协议从互联网上下载指定文件.
$InetGetSize = InetGetSize ( $URL ) ;以字节为单位返回存放在互联网上的指定文件的大小.
While @InetGetActive
$s_IniRead = IniRead("Temp.ini", "速度", "key", "NotFound") ;从某标准配置文件(*.ini)中读取某个数值.
$time1_IniRead = IniRead("Temp.ini", "time", "time1", "NotFound") ;从某标准配置文件(*.ini)中读取某个数值.
$time2_IniRead = IniRead("Temp.ini", "time", "time2", "NotFound") ;从某标准配置文件(*.ini)中读取某个数值.
$time_Down = $time2_IniRead - $time1_IniRead
$Bytes = @InetGetBytesRead/1024 ;在 InetGet 下载期间得到的数据大小(字节).
$Bytes_InetGetSize = Round ($InetGetSize/1024 ,-1) ;以字节为单位返回存放在互联网上的指定文件的大小. Round (四舍五入,-1)
TrayTip("Downloading ", "下载速度 = " & $Bytes - $s_IniRead & " KB " & " 已下载 = " & $Bytes & " KB " & " 总大小 = " & $Bytes_InetGetSize & " KB " & " 已用时间 " &$time_Down, 10, 16)
$s_IniWrite = IniWrite ( "Temp.ini", "速度", "key", $Bytes ) ;向某标准配置文件(*.ini)中写入某个数值.
$time2_IniWrite = IniWrite ( "Temp.ini", "time", "time2", @HOUR & @MIN & @SEC ) ;向某标准配置文件(*.ini)中写入某个数值.
$time3_IniWrite = IniWrite ( "Temp.ini", "time", "time3", $time2_IniRead - $time1_IniRead ) ;向某标准配置文件(*.ini)中写入某个数值.
Sleep(1000)
Wend
MsgBox(0, "提示", "总下载 = " & $Bytes/1024 & " MB " & " 平均速度 = " & $Bytes_InetGetSize/$time_Down & " KB " & $time_Down& " s ")
|