[教程][网络]AutoHotkey获取网络文件大小

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
}

人已赞赏
AHKV1学习

[教程][网络]AutoHotkey获取上网方式与链接状态

2016-8-10 10:00:37

AHKV1学习

[教程][网络]AutoHotkey请求PHP返回JSON字符串

2016-8-11 10:00:42

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索