1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Public Class Connection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
My.Settings.Username = TextBox1.Text
My.Settings.Password = TextBox2.Text
My.Settings.Retype = TextBox3.Text
'cette ligne correspond au parametre du projet
My.Settings.Status = True
My.Settings.Save()
MsgBox("User created succefully. Application will now restart")
Application.Restart()
Catch ex As Exception
MsgBox("Couldn't create account. Try again...")
End Try
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
If Not TextBox3.Text = TextBox2.Text Then
Label4.Text = "Password do not match"
Else
Label4.Text = ""
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.Status = True Then
Me.Hide()
Login.Show()
Me.Close()
Else
End If
End Sub
End Class |
Partager