15-05-18, 02:35 AM
كود :
Dim attempt As Integer = 1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim username, password As String
username = TextBox1.Text
password = TextBox2.Text
If username = "admin" And password = "1234" Then
MsgBox(" ! تم تسجيل الدخول بنجاح ", MsgBoxStyle.Information, "مرحبا")
Form2.Show()
Me.Hide()
ElseIf username = "user" And password = "1234" Then
MsgBox(" ! تم تسجيل الدخول بنجاح ", MsgBoxStyle.Information, "مرحبا")
Form2.Show()
Me.Hide()
ElseIf attempt = 3 Then
MsgBox(" ! لقد إستخدمت ثلاث محاولات خاطئه , سيتم إغلاق البرنامج الآن ", MsgBoxStyle.Information, "): ")
Close()
Else
MsgBox(" لديك ثلاث محاولات فقط قبل انها البرنامج " & attempt & " من 3 ", MsgBoxStyle.Information, "خطأ بتسجيل الدخول")
attempt = attempt + 1
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.Focus()
End If
End Subمنقوووووول من احد المنتديات للأمانة
