06-18-2011, 04:15 PM
(This post was last modified: 06-18-2011, 05:45 PM by Coding Support.)
This will teach you how to make a program that converts text to an MD5 Hash
Anything in Pink In my tutorial is important...
Step One(The GUI)
This part is simple. Just make the GUI Look similar to mine and move on to the next step(Step Two)
My GUI (Click to View)
Step Two
Step Two will be coding the Convert Button.Double click it and input this code...
Under the End Sub, put this code in...
You should Have This code...
Code:
textbox2.text = StringToMD5(textbox1.Text)
Code:
Private Function StringToMD5(ByVal Content As String) As String
You should Have This code...
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = StringToMD5(TextBox2.Text)
End Sub
Private Function StringToMD5(ByVal Content As String) As String
End Class
Step Three
Under Your private function, use this code...
Code:
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")
Next
Return FinalString
End Function
Final Code
Spoiler (Click to View)
You are done, Test is by using the word hi.
It should look like this
It should look like this