Jump to content

Search the Community

Showing results for tags 'winhttp exitloop'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi friends, if my $error variable is 1 I want to exit the loop For $m = 0 To UBound($a) - 1 How do I do it? Thank you Global $oMyError = ObjEvent("AutoIt.Error", "httperror") Global $error = 0 Local $a[3] = ["http://127.0.1.1", "http://127.0.0.2", "http://127.0.0.3"] Local $b[2] = ["Post1Test1", "Post1Test2"] Local $c[2] = ["Post2Test1", "Post2Test2"] For $m = 0 To UBound($a) - 1 For $X = 0 To UBound($b) - 1 For $i = 0 To UBound($c) - 1 $con = Connect($a[$m], $b[$X] & $c[$i]) ConsoleWrite(" Line Connect : " & @ScriptLineNumber & " -> " & $a[$m] & " " & $b[$X] & " " & $c[$i] & @CRLF) If $error = 1 Then ExitLoop EndIf Next Next Next Func Connect($Url, $PostData = '') Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $Url, False) $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0") $oHTTP.SetRequestHeader("Accept-Language", "tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.SetRequestHeader("X-Requested-With", "XMLHttpRequest") $oHTTP.Send($PostData) If @error Then ConsoleWrite("Error connection" & @CRLF) $error = 1 $oHTTP = 0 Return SetError(1) EndIf ConsoleWrite(" Line : " & @ScriptLineNumber & " -> Status : " & $oHTTP.Status & @CRLF) If $oHTTP.Status = 200 Then Local $sReceived = $oHTTP.ResponseText $oHTTP = Null Return $sReceived EndIf $oHTTP = Null Return -1 EndFunc ;==>Connect Func httperror() ConsoleWrite("http error" & @CRLF) $oMyError.Clear Return SetError(1) EndFunc ;==>httperror
×
×
  • Create New...