Jump to content
Sign in to follow this  
Leopardfist

Inetget problem

Recommended Posts

Leopardfist

I have a simple txt file on my server. The exact address is http://craftarr.com/Blacklist

I have been trying to troubleshoot why XProTect does not read it, so I wrote a little program to see if I could get it to read, and I cant. I don't know why. I don't know if I need specific server settings or what, but it definitely isnt reading. I can open it in a browser, not sure if that is the same or not.

Global $Name = "bill_michelle@live.com"
Global $pwn = 0
Global $Temp = 0

If INetGet("http://craftarr.com/blacklist.txt", $Temp, 1) = 1 Then
   Local $Str = fileread($Temp)
   filedelete($Temp)
   If StringInStr($Str, $Name) Then
      msgbox(0,"a","Yes")
   Else
      msgbox(0,"a","no")
   EndIf
Else
   msgbox(0, "Bad", "Did not read at all")
EndIf

Maybe someone can point out what I am doing wrong or what settings I need to add so it works?

Share this post


Link to post
Share on other sites
abberration

Have you considered InetRead?

$webURL = BinaryToString(InetRead("http://craftarr.com/Blacklist"))
MsgBox(0, "", $webURL)

RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites
Jos

You have a couple of issues in your script:

1. The var $temp should contain a filename

2. The url is wrong in your script since your webserver is case sensitive.

3. The If is wrong as InetGet returns the bytes received.

Global $Name = "bill_michelle@live.com"
Global $pwn = 0
Global $Temp = "blacklist.txt"

If INetGet("http://craftarr.com/Blacklist.txt", $Temp, 1) Then

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Leopardfist

Thanks Jos, that fixed it :). I was going according to the original script on XProTect.au3

If InetGet($D_Link & "Blacklist.txt", $rtemp, 1) = 1 Then
  $itemp = FileRead($rtemp)
  FileDelete($rtemp)
  If StringInStr($itemp, $X_read003) Or StringInStr($itemp, $ND_Mail) Then mError("This program has been abused and will now close    ", 6, 1)
 EndIf

Once I changed it to 

If InetGet($D_Link & "Blacklist.txt", $rtemp, 1) Then

It worked fine :).

THANK YOU SO MUCH!

Share this post


Link to post
Share on other sites
Leopardfist

 

Have you considered InetRead?

$webURL = BinaryToString(InetRead("http://craftarr.com/Blacklist"))
MsgBox(0, "", $webURL)

Thanks man, that actually lookos MUCH easier to do.

Share this post


Link to post
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
Sign in to follow this  

×