endlesslove_1998

[WinHttp-Obj] Get Source: google.com.vn

Dec 29th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.61 KB | None | 0 0
  1. Local $Url = "https://www.google.com.vn/"
  2. Local $Method = "GET"
  3.  
  4. Local $oHTTP = ObjCreate("Winhttp.winhttprequest.5.1")
  5. $oHTTP.Open($Method, $Url, False)
  6. $oHTTP.Option(0x0028, 0x0008)
  7. $oHTTP.SetRequestHeader("Content-Type", "text/html; charset=UTF-8")
  8. $oHTTP.Send()
  9.  
  10. _Test(BinaryToString($oHTTP.ResponseBody, 4))
  11.  
  12. Func _Test($sData, $sFileName = "test.html", $bRun = True, $bPlainText = True)
  13.     Local $hFile = FileOpen(@ScriptDir & "\" & $sFileName, 2 + 8 + ($bPlainText = True ? 256 : 0))
  14.     FileWrite($hFile, $sData)
  15.     FileClose($hFile)
  16.     If $bRun Then ShellExecute(@ScriptDir & "\" & $sFileName)
  17. EndFunc   ;==>_Test
Add Comment
Please, Sign In to add comment