|
-
Jun 27th, 2009, 02:50 PM
#1
Thread Starter
Junior Member
problem regarding webclient...HELP please
Actually i wanted to submit my username and password to a website to check whether its working properly or not. i got this idea when i was learning abt the webclient class in the system.net.. So i decided to check it with the gaming which i have a account on .. Then i coded a bit and created a real mess... Dono whats wrong with this even when i kno the username and password i mentioned are correct.. Kindly Help..plz
Code:
Dim checker As New WebClient
Dim data As Byte()
Dim username As Char
Dim password As Char
Dim result As Byte()
'Dim aa As String
checker.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
checker.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)")
data = Encoding.ASCII.GetBytes("ref=https%3A%2F%2Fwww.worldofwarcraft.com%2Faccount%2Fmenu.html&accountName=" + _
username + "&password=" + password)
result = checker.UploadData("https://us.battle.net/login/login.xml", "POST", data)
'aa = Encoding.ASCII.GetString(result)
If Encoding.ASCII.GetString(result).ToString.Contains("Game Account") Then
TextBox1.Text = "accountvalid"
Else
TextBox1.Text = "account not valid"
End If
-
Jun 27th, 2009, 03:06 PM
#2
Hyperactive Member
Re: problem regarding webclient...HELP please
Is an error message occurring at all?
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Jun 27th, 2009, 03:09 PM
#3
Re: problem regarding webclient...HELP please
I love these guessing games. How many goes do we get?
-
Jun 27th, 2009, 03:19 PM
#4
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
there is not at all an error message it just displays "account not working"... actually i can able to manually login in the site
https://us.battle.net/login/login.xm...unt%2F&app=wam
-
Jun 27th, 2009, 04:05 PM
#5
Re: problem regarding webclient...HELP please
So the obvious question is what does this evaluate to?
Code:
Encoding.ASCII.GetString(result).ToString
-
Jun 27th, 2009, 04:10 PM
#6
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
 Originally Posted by keystone_paul
So the obvious question is what does this evaluate to?
Code:
Encoding.ASCII.GetString(result).ToString
Hmm the result actually contains the Html page contents.. so the Game Account is the text in the html page..
-
Jun 27th, 2009, 11:34 PM
#7
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
-
Jun 28th, 2009, 02:26 AM
#8
Re: problem regarding webclient...HELP please
 Originally Posted by kingofquestions
Hmm the result actually contains the Html page contents.. so the Game Account is the text in the html page..
Well obviously according to your code "Game Account" is not in the string, so either the HTML doesn't contain what you think it does, or your test is incorrect.
As your test is pretty simple (maybe incorrect case?) the most likely thing is that the HTML doesn't contain what you expect it to.
Have you tried evaluating the result in the immediate window, copying and pasting that to notepad and doing a Find, searching for "Game Account". Does that find it?
-
Jun 28th, 2009, 11:55 AM
#9
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
yep it actually finds it... I guess the problem with that is the URl am using.. Since there is a lots of redirects..
Actually the main host stays as http://www.worldofwarcraft.com/account/ which redirects automatically redirects to https://us.battle.net/login/login.xm...unt%2F&app=wam the previous URI acts as a referrer here. when login is successful it redirects to the main host..
-
Jun 28th, 2009, 12:25 PM
#10
Hyperactive Member
Re: problem regarding webclient...HELP please
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Jun 28th, 2009, 01:06 PM
#11
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
hmmmm mind helping me with this problem dude???
-
Jun 28th, 2009, 02:20 PM
#12
Re: problem regarding webclient...HELP please
Blizzard/Battle.net have mechanisms in place to prevent this kind of thing from happening. For example, you'll see that they generate the source via XSLT. I'd suggest a simpler login form.
You need to make sure that when you call the form, you include all the fields that it's expecting. When viewing source on the page, look at the <input> fields.
-
Jun 28th, 2009, 04:03 PM
#13
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
 Originally Posted by mendhak
Blizzard/Battle.net have mechanisms in place to prevent this kind of thing from happening. For example, you'll see that they generate the source via XSLT. I'd suggest a simpler login form.
You need to make sure that when you call the form, you include all the fields that it's expecting. When viewing source on the page, look at the <input> fields.
mind explaining this to me bit clearly?? .. plz
-
Jul 10th, 2009, 02:44 AM
#14
Thread Starter
Junior Member
Re: problem regarding webclient...HELP please
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|