VB.net MD5加密

来源:互联网 发布:两列数据对比取相同 编辑:程序博客网 时间:2024/05/22 16:42

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

        Dim md5 As New MD5CryptoServiceProvider
        Dim HashValue As Byte() = md5.ComputeHash(Encoding.ASCII.GetBytes(PassWord.Text))
        Dim mdString As String = ""
        For i As Integer = 0 To HashValue.Length - 1
            mdString = mdString + Microsoft.VisualBasic.Right("00" + Format(HashValue(i), "X"), 2)
        Next

    End Sub

2010-10-10 09:50:21