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 }
暂无讨论,说说你的看法吧