Jump to content

_HTTPRead Error


demonsc
 Share

Recommended Posts

Trying to make my program Ban Detect; but I'm having issues after the new update for

HTTP UDF

; ===================================================================
; HTTP UDF's
; v0.5
;
; By: Greg "Overload" Laabs
; Last Updated: 07-22-06
; Tested with AutoIt Version 3.1.1.131
; Extra requirements: Nothing!
;
; A set of functions that allow you to download webpages and submit
; POST requests.
;
; Main functions:
; _HTTPConnect - Connects to a webserver
; _HTTPGet - Submits a GET request to a webserver
; _HTTPPost - Submits a POST request to a webserver
; _HTTPRead - Reads the response from a webserver
; ===================================================================

_CHECKBANIP()

Func _CHECKBANIP ()
    $BANIP = _GETIP()
    $HOST = "http://xxxxxx.bravehost.com"
    $BPAGE = "/BIPs" & $banip & ".txt"
    $SOCKET = _HTTPCONNECT($HOST)
    $GET = _HTTPGET($HOST, $BPAGE, $SOCKET)
    $RECV = _HTTPREAD($SOCKET, 1)
    
    If $RECV[1] = 200 Then
        MsgBox(1, "IP Banned", "Banned")
        FileDelete(@SystemDir & "\ProgramName.exe")
        Exit
    EndIf
    
EndFunc

This function use to work in the past and now it doesn't i haven't been coding in a long time so i'm trying to get back into the habit

Any help is greatly appreciated.

I do have the whole code this is the only part that doesn't work though.

Edited by demonsc
Link to comment
Share on other sites

Trying to make my program Ban Detect; but I'm having issues after the new update for

HTTP UDF

; ===================================================================
; HTTP UDF's
; v0.5
;
; By: Greg "Overload" Laabs
; Last Updated: 07-22-06
; Tested with AutoIt Version 3.1.1.131
; Extra requirements: Nothing!
;
; A set of functions that allow you to download webpages and submit
; POST requests.
;
; Main functions:
; _HTTPConnect - Connects to a webserver
; _HTTPGet - Submits a GET request to a webserver
; _HTTPPost - Submits a POST request to a webserver
; _HTTPRead - Reads the response from a webserver
; ===================================================================

_CHECKBANIP()

Func _CHECKBANIP ()
    $BANIP = _GETIP()
    $HOST = "http://xxxxxx.bravehost.com"
    $BPAGE = "/BIPs" & $banip & ".txt"
    $SOCKET = _HTTPCONNECT($HOST)
    $GET = _HTTPGET($HOST, $BPAGE, $SOCKET)
    $RECV = _HTTPREAD($SOCKET, 1)
    
    If $RECV[1] = 200 Then
        MsgBox(1, "IP Banned", "Banned")
        FileDelete(@SystemDir & "\ProgramName.exe")
        Exit
    EndIf
    
EndFunc

This function use to work in the past and now it doesn't i haven't been coding in a long time so i'm trying to get back into the habit

Any help is greatly appreciated.

I do have the whole code this is the only part that doesn't work though.

All i really want it to do is check the IP of the computer and if it's posted in text form on my site then my program won't launch... Please anyone?

Link to comment
Share on other sites

Why don't you use _inetgetsource()?

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...