-
[VB8] MD5 Encrypter
Code:
Public Class Form1
Private Sub btnEncrypt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEncrypt.Click
txtOutput.Text = StringToMD5(txtInput.Text)
End Sub
Private Function StringToMD5(ByVal Content As String) As String
'This code can also be applyed to the button code...
'I just prefer this into a function, so you can use it easely
Dim M5 As New Security.Cryptography.MD5CryptoServiceProvider
Dim ByteString() As Byte = System.Text.Encoding.ASCII.GetBytes(Content)
ByteString = M5.ComputeHash(ByteString)
Dim FinalString As String = Nothing
For Each bt As Byte In ByteString
FinalString &= bt.ToString("x2") 'x2 is just a string format
Next
Return FinalString
End Function
End Class
Basically make sure you put everything in the pictures here and change the name of the text box right under the input label from "textbox2" to "txtinpute". Then change the name from "textbox2" (Should be right under Output Label) to "txtoutput".Then the Buttons new name will be "btnEncrypt" instead of "button1"
Pictures:
Code:
http://i50.tinypic.com/908sgz.jpg
http://i45.tinypic.com/1gg03c.jpg
http://i48.tinypic.com/ea4gu1.jpg