bonjour, voila j'ai un petit problème avec mon programme quand je lance il m'affiche aucun résulta. pouvez-vous m'aider a résoudre ce problème.
voici en image:
http://imageshack.us/a/img90/9764/de...emd5erreur.jpg
mes codes:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Public Class Form1 Private ObjCmd5 As New Cmd5 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click TextBox1.Paste() Button1.Enabled = True End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim text As String = TextBox1.Text Dim alphabet As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&'()*+,-./:;<=>?@[\]^_'{|}~" Dim stopwatch As New Stopwatch Dim max As Integer = 1 stopwatch.Start() TextBox2.Text = ("" & 1) If ObjCmd5.CassMd5("", 1, alphabet, [text]) Then Do max += 1 stopwatch.Start() TextBox2.Text = ("" & max) Loop While ObjCmd5.CassMd5("", max, alphabet, [text]) End If TextBox3.Text = ObjCmd5.RetourChaine stopwatch.Stop() Dim elapsedMilliseconds As Integer = CInt(stopwatch.ElapsedMilliseconds) MessageBox.Show(("Trouvé en : " & CStr((elapsedMilliseconds * 0.001)) & " sec")) End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() Button1.Enabled = False End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Application.Exit() End Sub Private Sub LANCEMENTLOGICIELMD5ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles LANCEMENTLOGICIELMD5ToolStripMenuItem.Click Form2.Show() End Sub End Classvoici mon projet dans pièces jointe.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Imports System.Runtime.InteropServices Imports System.Text Imports System.Security.Cryptography Class Cmd5 Public Function CalcMd5(ByVal sChaine As String) As String Dim bytes As Byte() = New ASCIIEncoding().GetBytes(sChaine) Dim buffer As Byte() = New MD5CryptoServiceProvider().ComputeHash(bytes) Dim builder As New StringBuilder(buffer.Length) Dim index As Integer = 0 If (0 < buffer.Length) Then Do builder.Append(buffer(index).ToString("X2")) index += 1 Loop While (index < buffer.Length) End If Return builder.ToString End Function Public Function CassMd5(ByVal chaine As String, ByVal max As Integer, ByVal alphabet As String, ByVal CrypterPass As String) As <MarshalAs(UnmanagedType.U1)> Boolean If (chaine.Length = max) Then If (CalcMd5(chaine) = CrypterPass) Then RetourChaine = chaine Return True End If Return False End If Dim num As Integer = 0 Do If CassMd5((chaine & alphabet.Chars(num)), max, alphabet, CrypterPass) Then Return True End If num += 1 Loop While (num < &H24) Return False End Function Public RetourChaine As String End Class
Merci,cordialement
Partager