Jump to content

republican

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by republican

  1. Yet, this error is very strange. I try to use 'xmlhttp' but also gets an error. I think is a bug of WinHttp.dll. What's your opinion? Now my way to solve this problem is to use WinInet. It works well in windows 7.
  2. I don't know why I receive ERROR_INTERNET_INCORRECT_HANDLE_STATE when try to get responds from 'webmail.stu.edu.cn' in either windows 7 x86 or x64(caused by _WinHttpQueryDataAvailable()), here is the simple code. #include "WinHttp.au3" Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.0.3; .NET CLR 2.0.50727; ffco7) Gecko/2008092417 Firefox/3.0.3") Global $hConnect = _WinHttpConnect($hOpen, "webmail.stu.edu.cn") $Var = _WinHttpSimpleRequest($hConnect) If @error Then MsgBox(64,@error,$Var) ; Close handles _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) Thanks
  3. It works very well, Thank you!~~~
  4. How to Use SetOption to set a Proxy? by using this code,I receive ERROR_INVALID_PARAMETER, what's wrong with it? #include <winhttp.au3> $MyOpen=_WinHttpOpen() $tWINHTTP_PROXY_INFO = DllStructCreate("DWORD dwAccessType[2];wchar lpszProxy[18];wchar lpszProxyBypass[7]") DllStructSetData($tWINHTTP_PROXY_INFO,1,$WINHTTP_ACCESS_TYPE_NAMED_PROXY) DllStructSetData($tWINHTTP_PROXY_INFO,2,"119.40.187.49:8080") DllStructSetData($tWINHTTP_PROXY_INFO,3,"<local>") $pWINHTTP_PROXY_INFO=DllStructGetPtr($tWINHTTP_PROXY_INFO) If @error Then MsgBox(0,"1",@error) _WinHttpSetOption($MyOpen,$WINHTTP_OPTION_PROXY,$pWINHTTP_PROXY_INFO,DllStructGetSize($tWINHTTP_PROXY_INFO)) If @error Then MsgBox(0,@error,_GetLastError_Winhttp()) _WinHttpCloseHandle($MyOpen) Func _GetLastError_Winhttp() Local $lastError = DllCall ( "kernel32.dll", "dword", "GetLastError" ) Return $lastError[0] EndFunc
×
×
  • Create New...