Advertisement
Guest User

Untitled

a guest
Aug 7th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. Public Class Register
  2.  
  3. Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
  4. Dim Result As Integer
  5. If TextBox1.Text = Nothing Or TextBox2.Text = Nothing Or TextBox3.Text = Nothing Or TextBox4.Text = Nothing Then
  6. ErrorMsg("Merci de remplir tous les champs")
  7. Exit Sub
  8. End If
  9. If TextBox3.Text <> TextBox4.Text Then
  10. ErrorMsg("Les mots de passe doivent être identiques")
  11. Exit Sub
  12. End If
  13. Result = Register(TextBox1.Text, TextBox2.Text, TextBox3.Text)
  14. If Result = 1 Then
  15. MessageBox.Show("Inscription terminée", "Inscription", MessageBoxButtons.OK, MessageBoxIcon.Information)
  16. Me.Close()
  17. End If
  18. End Sub
  19.  
  20. Private Sub Bouton_6_Click(sender As System.Object, e As System.EventArgs) Handles Bouton_6.Click
  21. End
  22. End Sub
  23.  
  24.  
  25. Public Function Register(RegisterKey As String, User As String, Password As String) As Integer
  26. Dim Response As String
  27. Dim SessionID As String = RandomChar(10)
  28.  
  29. Response = GetResponse(SessionID, "https://logiciel.lunasiagames.net/LunasiaGames/action.php?" &
  30. "action=register" &
  31. "&sessionID=" & SessionID &
  32. "&user=" & User &
  33. "&password=" & Password &
  34. "&registerKey=" & RegisterKey)
  35. If Response = Nothing Then Return 0
  36. If CheckError(Response) = True Then Return 0
  37. If Not Response.StartsWith("OK") Then
  38. ErrorMsg("Erreur")
  39. Return 1
  40. End If
  41. Return If(Response.EndsWith("1"), 2, 1)
  42. End Function
  43.  
  44. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement