找回密码
 加入
搜索
查看: 1626|回复: 0

[AU3基础] 请教怎样将以下代码可以使用在winnt 4.0上?在哪儿可以找到wininet.dll的调用方法

[复制链接]
发表于 2013-9-13 11:16:09 | 显示全部楼层 |阅读模式
func _FTP_Open($sAgent, $lAccessType = 1, $lFlags = 0, $sProxyName = '', $sProxyBypass = '')
        
        local $Ret = DllCall($WININET_DLL, 'hwnd', 'InternetOpen', 'str', $sAgent, 'dword', $lAccessType, 'str', $sProxyName, 'str', $sProxyBypass, 'dword', $lFlags)
        
        if (@error) or ($Ret[0] = 0) then
                return SetError(1, _WinAPI_GetLastError(), 0)
        endif
        
        return SetError(0, 0, $Ret[0])
endfunc; _FTP_Open


func _FTP_Close($hFtp)
        
        local $Ret = DllCall($WININET_DLL, 'int', 'InternetCloseHandle', 'hwnd', $hFtp)
        
        if (@error) or ($Ret[0] = 0) then
                return SetError(1, _WinAPI_GetLastError(), 0)
        endif
        
        return SetError(0, 0, 1)
endfunc; _FTP_Close


func _FTP_Connect($hFtp, $sServerName, $sUsername, $sPassword, $lServerPort = 0, $lFlags = 0x08000000, $lContext = 0)
        
        local $Ret = DllCall($WININET_DLL, 'hwnd', 'InternetConnect', 'hwnd', $hFtp, 'str', $sServerName, 'int', $lServerPort, 'str', $sUsername, 'str', $sPassword, 'dword', 1, 'dword', $lFlags, 'dword', $lContext)
        
        if (@error) or ($Ret[0] = 0) then
                return SetError(1, _WinAPI_GetLastError(), 0)
        endif
        
        return SetError(0, 0, $Ret[0])
endfunc; _FTP_Connect

func _FTP_DeleteFile($hSession, $sFileName)
        
        local $Ret = DllCall($WININET_DLL, 'int', 'FtpDeleteFile', 'hwnd', $hSession, 'str', $sFileName)
        
        if (@error) or ($Ret[0] = 0) then
                return SetError(1, _WinAPI_GetLastError(), 0)
        endif
        
        return SetError(0, 0, 1)
endfunc; _FTP_DeleteFile


func _FTP_GetFile($hSession, $sRemoteFile, $sLocalFile, $fFailIfExists = 0, $lAttributes = 0, $lFlags = 0, $lContext = 0)
        
        local $Ret = DllCall($WININET_DLL, 'int', 'FtpGetFile', 'hwnd', $hSession, 'str', $sRemoteFile, 'str', $sLocalFile, 'int', $fFailIfExists,  'dword', $lAttributes, 'dword', $lFlags, 'dword', $lContext)
        
        if (@error) or ($Ret[0] = 0) then
                return SetError(1, _WinAPI_GetLastError(), 0)
        endif
        
        return SetError(0, 0, 1)
endfunc; _FTP_GetFile
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-23 17:42 , Processed in 0.072304 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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