TextBox2.Text = MD5(ListView1.Text)
TextBox1.Text = OpenFileDialog1.FileName textbox2.text = md5(textbox1.text) ListRAR(TextBox1.Text)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionTextBox1.Text = OpenFileDialog1.FileName ListRAR(TextBox1.Text) TextBox2.Text = MD5(ListView1.Text)
Public Function MD5(ByVal str As String) As String Dim ASCIIenc As New System.Text.ASCIIEncoding Dim ByteSource() As Byte = ASCIIenc.GetBytes(str) Dim Md5Hash As New Security.Cryptography.MD5CryptoServiceProvider Dim ByteHash() As Byte = Md5Hash.ComputeHash(ByteSource) For Each b As Byte In ByteHash strReturn &= b.ToString("x2") Next Return strReturn End Function
mais c pas ça que j'ai demanderC'est pourtant ce que tu as demandé ici :
pour afficher sur textbox2 en MD5.Enfin passons
en listview1 pour afficher sur textbox2 en MD5.
Public Function MD5(ByVal str As String) As String Dim ASCIIenc As New System.Text.ASCIIEncoding Dim ByteSource() As Byte = ASCIIenc.GetBytes(str) Dim Md5Hash As New Security.Cryptography.MD5CryptoServiceProvider Dim ByteHash() As Byte = Md5Hash.ComputeHash(ByteSource) For Each b As Byte In ByteHash strReturn &= b.ToString("x2") Next Return strReturn End Function
TextBox2.Text = MD5(ListView1.Text)
function md5(byval pathfichier as string) as string Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider Dim fmd5 As IO.FileStream = New IO.FileStream(pathfichier, IO.FileMode.Open, IO.FileAccess.Read) md5.ComputeHash(fmd5) Dim hash As Byte() = md5.Hash Dim buff As System.Text.StringBuilder = New System.Text.StringBuilder For Each hashByte as byte In hash buff.Append(String.Format("{0:X2}", hashByte)) Next md5.Clear() fmd5.Close() fmd5.Dispose() return buff.tostring end function