Sign in to follow this  
Followers 0
toxicvn

libcurl.dll help !

1 post in this topic

Global Const $CURLOPT_URL = 0x2712
Global Const $CURLOPT_WRITEDATA = 0x2711
Global Const $CURLOPT_WRITEFUNCTION = 0x4E2B
Global Const $CURLOPT_PROGRESSFUNCTION = 0x4E58
Global Const $CURLOPT_NOPROGRESS = 0x2B
Global Const $CURLOPT_ERRORBUFFER = 0x271A
Global Const $CURLOPT_TRANSFERTEXT = 0x35
Global Const $CURL_ERROR_SIZE = 0x100
Global Const $CURL_ENCODING = 10102
Global Const $CURLOPT_VERBOSE  = 41
Global Const $CURLINFO_RESPONSE_CODE = 0x200002
Global Const $CURLOPT_FILETIME = 69
Global Const $CURLINFO_HTTP_CONNECTCODE = 0x200016
Global Const $CURLINFO_REQUEST_SIZE = 0x20000C
Global Const $CURLINFO_CONNECT_TIME = 0x300005
Global Const $CURLINFO_CONTENT_TYPE  = 0x100012

; Load and initialize curl
$hDll_LibCurl = DllOpen("libcurl.dll")
$hCurlHandle = DllCall($hDll_LibCurl, "ptr:cdecl", "curl_easy_init")
$hCurlHandle = $hCurlHandle[0]


getinfo()
Func getinfo()
dim $inf
DllCall($hDll_LibCurl, "uint:cdecl", "curl_easy_setopt", "ptr", $hCurlHandle, "uint", $CURL_ENCODING, "str", "")


$URL = DllStructCreate("char[256]")

$my_url="http://www.google.com.vn"


DllStructSetData($URL, 1,$my_url)
DllCall($hDll_LibCurl, "uint:cdecl", "curl_easy_setopt", "ptr", $hCurlHandle, "uint", $CURLOPT_URL, "ptr", DllStructGetPtr($URL))
DllCall($hDll_LibCurl, "uint:cdecl", "curl_easy_setopt", "ptr", $hCurlHandle, "uint", $CURLOPT_FILETIME, "ptr", true)
$nPerform = DllCall($hDll_LibCurl, "uint:cdecl", "curl_easy_perform", "ptr", $hCurlHandle)

$infos = DllCall($hDll_LibCurl, "uint:cdecl", "curl_easy_getinfo", "uint", $CURLINFO_CONNECT_TIME, "ptr", $inf)

consoleWrite(@CRLF & "info :"& $inf &  @CRLF &  @CRLF)
DllCall($hDll_LibCurl, "none:cdecl", "curl_easy_cleanup", "ptr", $hCurlHandle)
EndFunc

why it not working ?? help me please

thank  !!! :D  :D :D

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0