อ่าน Naruto 700 แปลไทย, อ่าน One Piece 782 แปลไทย, อ่าน Bleach 622 แปลไทย, อัพเดทข่าวประจำวันและข่าวไอที โหลดเพลง โหลดโปรแกรม คำคมโดนๆ
SMF & Programmer => Programmer => ข้อความที่เริ่มโดย: Admin ที่ กุมภาพันธ์ 21, 2012, 09:26:33 pm
-
[mb]
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Function GenerateHash(ByVal strToHash As String) As String
Dim md5Obj As New Security.Cryptography.MD5CryptoServiceProvider
Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
bytesToHash = md5Obj.ComputeHash(bytesToHash)
Dim strResult As String = ""
For Each b As Byte In bytesToHash
strResult += b.ToString("x2")
Next
Return strResult
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = GenerateHash(TextBox1.Text) 'Output = MD5Hash(Input)
End Sub
End Class
[/mb]
-
ใจจ้า