Help (Get text from .php website) [solved]

Posts 16–20 of 20 · Page 2 of 2
This is 100% working because I *JUST* tested it

[highlight=vb.net]
Private Function IsHackAvailable(ByVal searchURL As String) As Boolean
Dim initRequest As Net.HttpWebRequest = CType(Net.WebRequest.Create(searchURL), Net.HttpWebRequest)
Using initResponse As Net.HttpWebResponse = CType(initRequest.GetResponse, Net.HttpWebResponse)
Dim buffer(100) As Byte
initResponse.GetResponseStream().Read(buffer, 0, buffer.Length)
Return System.Text.Encoding.UTF8.GetString(buffer).ToLowe r().Contains("true")
End Using
End Function
[/highlight]

To use:

[highlight=vb.net]
Dim isAvail As Boolean = IsHackAvailable("http://********.com/hackstatus.php")
If isAvail Then
MessageBox.Show("The hack is available")
Else
MessageBox.Show("The hack is currently unavailable")
End If
[/highlight]

There is absolutely NO NEED for you to change the "IsHackAvailable" function, so don't touch it!
If its just to check if its false or true, you could also let the program download a file, and read all text. Like people use for updating...

[highlight=vb.net]
Dim file As String = Application.StartupPath & "/check.txt" 'Check = The file it will download + check
If My.Computer.FileSystem.FileExists(file) Then
My.Computer.FileSystem.DeleteFile(file)
End If
My.Computer.Network.DownloadFile("http:/rsite/check.txt", file) 'get a free website with a ftp server (like 000wh)
Dim check as String = My.Computer.FileSystem.ReadAllText(file) 'reads the text
If check = "true" 'if the text of the check.txt = true
MsgBox("true") 'put the actions it should do if its true here
Else
MsgBox("false") 'put the actions it should do if its false here
End If


[/highlight]


To make this work you'll need:
- A .txt file with the text: True or False
- A ftp server, wich can be made free, very easy.
If you want to change the text:
go to your check.txt, change it, upload it again on the ftp server, done. (make sure the names are the same)
Quote Originally Posted by Leaf View Post
If its just to check if its false or true, you could also let the program download a file, and read all text. Like people use for updating...

[highlight=vb.net]
Dim file As String = Application.StartupPath & "/check.txt" 'Check = The file it will download + check
If My.Computer.FileSystem.FileExists(file) Then
My.Computer.FileSystem.DeleteFile(file)
End If
My.Computer.Network.DownloadFile("http:/rsite/check.txt", file) 'get a free website with a ftp server (like 000wh)
Dim check as String = My.Computer.FileSystem.ReadAllText(file) 'reads the text
If check = "true" 'if the text of the check.txt = true
MsgBox("true") 'put the actions it should do if its true here
Else
MsgBox("false") 'put the actions it should do if its false here
End If


[/highlight]


To make this work you'll need:
- A .txt file with the text: True or False
- A ftp server, wich can be made free, very easy.
If you want to change the text:
go to your check.txt, change it, upload it again on the ftp server, done. (make sure the names are the same)
Why would we download a new textfile and reading and shit
when we can just read a string from a webpage
cuz its easier to code, and this code always works, and is much easier to understand imo. Also, its done in a second or so. (the whole process)
Quote Originally Posted by Leaf View Post
cuz its easier to code, and this code always works, and is much easier to understand imo. Also, its done in a second or so. (the whole process)
There is no point downloading it and storing it on the PC, people hate programs that put files and shit all over their computer, it can also be picked up as a virus by some scanners. The way I've done it is just to simulate a request to the webpage and read the response. Works faster, and your method won't work with a PHP file anyway.
Posts 16–20 of 20 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us