Click here to Skip to main content
16,022,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys Im working on a game and this is the login system.
I always get the Username or password do not match for no reason.
It started today, before it worked perfectly.

I tested everything: for example textbox1 to show "encrypted" and textbox2 to show the encrypted password from the server, everything is fine the pass in the server and the client both match.

PS: Ignore the comments they are in my native language.
VB
Private Sub loginbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loginbutton.Click
        loginbutton.Image = My.Resources.largeButton_orange_down

        'Check if blank, jepi vlera variablave.
        If TextBox1.Text.Length = 0 Or TextBox2.Text.Length = 0 Then
            MsgBox("One of the fields is blank.")
            Exit Sub
        Else
            username = TextBox1.Text
            passwordclient = TextBox2.Text
        End If
        encrypted = StringToMD5(passwordclient)

        'Lidhja me serverin.
        Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://yugiohdatabase.byethost7.com/database/" & username)
        Dim resp As System.Net.WebResponse = req.GetResponse
        Str = resp.GetResponseStream
        srRead = New System.IO.StreamReader(Str)
        'Read all the text 
        passwordserver = srRead.ReadToEnd
        System.Threading.Thread.Sleep(1000)

        'Shikon nese passwordet jane te njejte.
        If passwordserver = encrypted Then
            Form2.Show()
            Me.Hide()
        Else
            MsgBox("Password or Username do not match, please retry.", MsgBoxStyle.OkOnly, "Login failed")
        End If
Posted
Updated 19-Jun-12 0:41am
v2
Comments
tiggerc 19-Jun-12 7:25am    
does what you are getting back from the server match what is stored on the server?
ShinigamiXoY 19-Jun-12 10:09am    
Yes

1 solution

Did you check the encoding of the strings? "encrypted" is likely unicode (I do not know your function StringToMD5), but the passwordserver could be anything else.
 
Share this answer
 
Comments
ShinigamiXoY 19-Jun-12 10:08am    
No I checked them they are both the same, I added the code textbox1.text = encrypted and textbox2.text = serverpassword to be sure that they were the same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900