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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Public Class Form1
Dim UpperCase As String
Dim Lowercase As String
Dim Digits As String
Dim ObjCmd5 As New Cmd5
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 0
End Sub
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.MaxLength = 32
Button1.Enabled = True
ComboBox1.Enabled = True
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select ComboBox1.SelectedIndex
Case 1
UpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Case 2
Lowercase = "abcdefghijklmnopqrstuvwxyz"
Case 3
Digits = "1234567890"
End Select
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Dim text As String = TextBox1.Text
Dim alphabet As String = ComboBox1.SelectedIndex
Dim stopwatch As New Stopwatch
Dim maxi As String = 1
stopwatch.Start()
TextBox3.Text = ("" & 1)
If Not ObjCmd5.button1("", 1, alphabet, text) Then
Do
maxi += 1
stopwatch.Start()
TextBox3.Text = ("" & maxi)
Loop While Not ObjCmd5.button1("", maxi, alphabet, text)
End If
TextBox2.Text = ObjCmd5.RetourChaine
stopwatch.Stop()
Timer1.Stop()
Dim elapsedMilliseconds As Integer = CInt(stopwatch.ElapsedMilliseconds)
MessageBox.Show(("Trouvé en : " & CStr((elapsedMilliseconds * 0.001)) & " sec"))
End Sub
End Class |
Partager