Jump to content

Seminoob

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Seminoob

  1. ​Oh, ok. I grabbed this one off the AutoIt website but it may have been a little while ago. I'll update, try it again and get back to the thread if I have any more questions. Thank you so much for looking into this. If I could, I would by you a pizza.
  2. ​This is what I get when I run the script "Redirect.au3"
  3. ​I downloaded 1.6.3.6 and put that in the same folder as the test. The help file that came with the code says,"WinHttp-UDFs for AutoIt and this helpfile are created by trancexx and ProgAndy. Current version is 1.6.3.6"
  4. #include "WinHttp.au3" $initialurl = "http://google.com" ; Initialize and get session handle $hOpen = _WinHttpOpen() ; Get connection handle $hConnect = _WinHttpConnect($hOpen, $initialurl) ; Register Callback function $hREDIRECT_CALLBACK = DllCallbackRegister("_Redirect", "none", "handle;dword_ptr;dword;ptr;dword") ; Set callback _WinHttpSetStatusCallback($hConnect, $hREDIRECT_CALLBACK, $WINHTTP_CALLBACK_FLAG_REDIRECT) ; Make a request $hRequest = _WinHttpSimpleSendRequest($hConnect, Default, "/") ;Here the request follow the redirection and land on a different webpage MsgBox(1, "Testing", @error) ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; Free callback DllCallbackFree($hREDIRECT_CALLBACK) ; Define callback function Func _Redirect($hConnect, $iContext, $iInternetStatus, $pStatusInformation, $iStatusInformationLength) Local $sStatus = "About to automatically redirect the request to: " & DllStructGetData(DllStructCreate("wchar[" & $iStatusInformationLength & "]", $pStatusInformation), 1) & " " ConsoleWrite("!>" & $sStatus & @CRLF) MsgBox(4096, "REDIRECTION:", $sStatus) EndFuncThis is the code I am testing. I can get the msgbox to tell me the @error is 1 but that is the only msgbox that shows up. test.au3
  5. Thank you, and I apologize if I did something that is contrary to the forum guidelines or rules. I am using WinHTTP v. 1.6.3.8 and the code that is posted by trancexx is what I have been testing. I haven't altered it other than to put quotes around the function name in the DllCallbackRegister method call.
  6. Hi, I'm kinda new to this and this is the only post I could find on this subject but I am not able to get this code to work. The _WinHTTPSimpleSendRequest method is setting @error to 1. Has there been a change in the au3 since Sept? Possibly something in my environment? Please let me know if you have any idea why this isn't working. Thanks!
×
×
  • Create New...