Advertisement
nhockm4v

Untitled

Apr 13th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.67 KB | None | 0 0
  1. #include <IE.au3>
  2.  
  3. GUICreate("Test User-Agent String", 700, 500)
  4. _IEErrorHandlerRegister()
  5. $oIE = _IECreateEmbedded()
  6. GUICtrlCreateObj($oIE, 10, 10, 680, 480)
  7. _SetUserAgent('User-Agent: đat đep trai.')
  8. _IENavigate($oIE, "http://www.useragentstring.com/")
  9. Sleep(1000)
  10. GUISetState()
  11.  
  12. While GUIGetMsg() <> -3
  13. WEnd
  14.  
  15. Func _SetUserAgent($agent)
  16.     $agentLen = StringLen($agent)
  17.     Dim $tBuff = DllStructCreate("char[" & $agentLen & "]")
  18.     DllStructSetData($tBuff, 1, $agent)
  19.     $chk_UrlMkSetSessionOption = DllCall("urlmon.dll", "long", "UrlMkSetSessionOption", "dword", 0x10000001, "ptr", DllStructGetPtr($tBuff), "dword", $agentLen, "dword", 0)
  20. EndFunc   ;==>_SetUserAgent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement