Results 1 to 14 of 14

Thread: problem regarding webclient...HELP please

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    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

  2. #2
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    UK
    Posts
    489

    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)

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: problem regarding webclient...HELP please

    I love these guessing games. How many goes do we get?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    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

  5. #5
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: problem regarding webclient...HELP please

    So the obvious question is what does this evaluate to?

    Code:
    Encoding.ASCII.GetString(result).ToString

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    Re: problem regarding webclient...HELP please

    Quote Originally Posted by keystone_paul View Post
    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..

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    Re: problem regarding webclient...HELP please

    help plz.... any1 alive?

  8. #8
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: problem regarding webclient...HELP please

    Quote Originally Posted by kingofquestions View Post
    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?

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    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..

  10. #10
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    UK
    Posts
    489

    Re: problem regarding webclient...HELP please

    Yeah that makes sense.
    Learning C♯

    Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    Re: problem regarding webclient...HELP please

    hmmmm mind helping me with this problem dude???

  12. #12
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    Re: problem regarding webclient...HELP please

    Quote Originally Posted by mendhak View Post
    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

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Jun 2009
    Posts
    23

    Re: problem regarding webclient...HELP please

    still need help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width