Public Class Form1
Dim say As String
Const sifre As String = "deneme"
Const yanliskacolacak As String = "3"
Private Function sifrecontrol(ByVal txt As TextBox) As Boolean
If TextBox1.Text = sifre Then
MsgBox("Afferim giriş ok ama " & say & " kerede girebildin!")
sifrecontrol = True
Exit Function
End If
If say = yanliskacolacak Then
MsgBox("Giriş hakkın bitti", vbCritical, "DgrŞifre")
sifrecontrol = False
Button1.Enabled = False
TextBox1.Focus()
Else
If txt.Text <> sifre Then
Button1.Text = "Olur böyle fakalare"
say = say + 1
MsgBox("Hatali şifre girdiniz! Kalan hakkınız" _
& Space(2) & yanliskacolacak - say, vbInformation, "DGR Control")
Button1.Text = "DENE BAKALIM" & vbCrLf & "Kalan Hakkın ; " & yanliskacolacak - say
sifrecontrol = False
TextBox1.Focus()
If say = yanliskacolacak Then
MsgBox("Giriş hakkın bitti..", vbCritical, "Dgr Şifre")
sifrecontrol = False
Button1.Text = "DENE BAKALIM" & vbCrLf & "Kalan Hakkın ; " & yanliskacolacak - say
Button1.Enabled = False
End If
Else
MsgBox("Afferim giriş ok ama " & say & " kerede girebildin")
sifrecontrol = True
Me.Hide()
End If
End If
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
say = 0
Button1.Text = "DENE BAKALIM" & vbCrLf & "Kalan Hakkın ; " & yanliskacolacak - say
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
sifrecontrol(TextBox1)
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = sifre Then
Button1.Enabled = True
End If
End Sub
End Class
Dim say As String
Const sifre As String = "deneme"
Const yanliskacolacak As String = "3"
Private Function sifrecontrol(ByVal txt As TextBox) As Boolean
If TextBox1.Text = sifre Then
MsgBox("Afferim giriş ok ama " & say & " kerede girebildin!")
sifrecontrol = True
Exit Function
End If
If say = yanliskacolacak Then
MsgBox("Giriş hakkın bitti", vbCritical, "DgrŞifre")
sifrecontrol = False
Button1.Enabled = False
TextBox1.Focus()
Else
If txt.Text <> sifre Then
Button1.Text = "Olur böyle fakalare"
say = say + 1
MsgBox("Hatali şifre girdiniz! Kalan hakkınız" _
& Space(2) & yanliskacolacak - say, vbInformation, "DGR Control")
Button1.Text = "DENE BAKALIM" & vbCrLf & "Kalan Hakkın ; " & yanliskacolacak - say
sifrecontrol = False
TextBox1.Focus()
If say = yanliskacolacak Then
MsgBox("Giriş hakkın bitti..", vbCritical, "Dgr Şifre")
sifrecontrol = False
Button1.Text = "DENE BAKALIM" & vbCrLf & "Kalan Hakkın ; " & yanliskacolacak - say
Button1.Enabled = False
End If
Else
MsgBox("Afferim giriş ok ama " & say & " kerede girebildin")
sifrecontrol = True
Me.Hide()
End If
End If
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
say = 0
Button1.Text = "DENE BAKALIM" & vbCrLf & "Kalan Hakkın ; " & yanliskacolacak - say
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
sifrecontrol(TextBox1)
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = sifre Then
Button1.Enabled = True
End If
End Sub
End Class
ByAyyas 42

