Size:= InternetFileGetSize("http://habit-2015.54fe89771abc8.d01.nanoyun.com/Habit/Habit.exe") MsgBox % Size Return InternetFileGetSize(URL:=""){ Static LIB="WININET\", CL="00000000000000", N="" QRL := 16 If ! DllCall( "GetModuleHandle", Str,"wininet.dll" ) DllCall( "LoadLibrary", Str,"wininet.dll" ) If ! hIO:=DllCall( LIB "InternetOpenA", Str,N, UInt,4, Str,N, Str,N, UInt,0 ) Return -1 If ! (( hIU:=DllCall( LIB "InternetOpenUrlA", UInt,hIO, Str,URL, Str,N, Int,0, UInt,F , UInt,0 ) ) || ErrorLevel ) Return "",0 - ( !DllCall( LIB "InternetCloseHandle", UInt,hIO ) ) - 2 If ! ( RB ) If ( SubStr(URL,1,4) = "ftp:" ) CL := DllCall( LIB "FtpGetFileSize", UInt,hIU, UIntP,0 ) Else If ! DllCall( LIB "HttpQueryInfoA", UInt,hIU, Int,5, Str,CL, UIntP,QRL, UInt,0 ) Return "",0 - ( !DllCall( LIB "InternetCloseHandle", UInt,hIU ) ) - ( !DllCall( LIB "InternetCloseHandle", UInt,hIO ) ) - 4 return CL }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。