Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Register
- Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
- Dim Result As Integer
- If TextBox1.Text = Nothing Or TextBox2.Text = Nothing Or TextBox3.Text = Nothing Or TextBox4.Text = Nothing Then
- ErrorMsg("Merci de remplir tous les champs")
- Exit Sub
- End If
- If TextBox3.Text <> TextBox4.Text Then
- ErrorMsg("Les mots de passe doivent être identiques")
- Exit Sub
- End If
- Result = Register(TextBox1.Text, TextBox2.Text, TextBox3.Text)
- If Result = 1 Then
- MessageBox.Show("Inscription terminée", "Inscription", MessageBoxButtons.OK, MessageBoxIcon.Information)
- Me.Close()
- End If
- End Sub
- Private Sub Bouton_6_Click(sender As System.Object, e As System.EventArgs) Handles Bouton_6.Click
- End
- End Sub
- Public Function Register(RegisterKey As String, User As String, Password As String) As Integer
- Dim Response As String
- Dim SessionID As String = RandomChar(10)
- Response = GetResponse(SessionID, "https://logiciel.lunasiagames.net/LunasiaGames/action.php?" &
- "action=register" &
- "&sessionID=" & SessionID &
- "&user=" & User &
- "&password=" & Password &
- "®isterKey=" & RegisterKey)
- If Response = Nothing Then Return 0
- If CheckError(Response) = True Then Return 0
- If Not Response.StartsWith("OK") Then
- ErrorMsg("Erreur")
- Return 1
- End If
- Return If(Response.EndsWith("1"), 2, 1)
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement