read some strings from url

spookyman166

New member
Joined
Dec 21, 2007
Messages
3
Location
New Zealand
Programming Experience
Beginner
Im new to this forum!

I started vb.net last night so cut me some slack.

I have decided to make my first simple project.

a auth checker package.

i have the 2 text boxes with "user" and "password"

but i need vb to open the url (no browser just open it) and read some strings
like "not valid password" , "valid password", "name doesnt exist "
etc

can you please help me?

thanks spooky
 
Would DownloadString method of WebClient suffice? It gets you the full string that the url would give a browser.
 
no

i need something that will read the actual webpage not the address bar

and the web link would be something like :

"hutjzdl.freegost.com/login?user="&username"password="&password

and then a php script would echo a 1 or 2 or 3

and the vb would read that and figure out to:

display "valid login" and the auth would be successfull
display "wrong password"
display "username dont exist"

etc

thanks spooky
 
I think my suggestion would work for that.
 
would this method work?
Dim myrequest As WebRequest = WebRequest.Create("http://dfadfadfas/tp/index.php?action=login2&auth=" + ListBox1.Text + "&passwrd=" + ListBox2.Text + "&cookielength=-1")

Dim myResponse As WebResponse = myrequest.GetResponse()



If InStr(WS, "2") Then
TextBox3.Text = (ListBox1.Text + " : " + ListBox2.Text) & vbNewLine
MessageBox.Show("auth valid")

Else
InStr(WS, "2")
System.Threading.Thread.Sleep(5000)
messagebox.show("Auth not valid")
 
It's a start (the first two lines), but WebClient is much easier, it is just a collection of common code that makes WebRequests easy to handle for basic needs.
 
Back
Top