函数参考


_WinHttpCloseHandle

关闭一个HTTP句柄.

#Include <WinHttp.au3>
_WinHttpCloseHandle($hInternet)

参数

$hInternet 要被关闭的一个有效句柄.

返回值

成功: 返回 1
失败: 返回 0 并设置 @error:
1 - DllCall 失败

注意/说明

None.

相关

_WinHttpConnect, _WinHttpOpen, _WinHttpOpenRequest

详情参考

http://msdn.microsoft.com/en-us/library/aa384090(VS.85).aspx

示例/演示


#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#include "WinHttp.au3"

Opt("MustDeclareVars", 1)

; 初始化并获取会话句柄
Global $hOpen = _WinHttpOpen()
If @error Then
    MsgBox(48, "Error", "Error initializing the usage of WinHTTP functions.")
    Exit 1
EndIf

; 关闭它
_WinHttpCloseHandle($hOpen)
If @error Then
    ConsoleWriteError("!Error closing the handle. @error = " & @error & @CRLF)
    MsgBox(48, "Error", "Error closing the handle." & @CRLF & "Error number is " & @error)
Else
    ConsoleWrite("+ Handle is succesfully closed." & @CRLF)
    MsgBox(64, "Closed", "Handle is succesfully closed.")
EndIf