
Originally Posted by
bombsaway707
Need: VB 2008
In Your Application Make 2 Textboxes, and 2 buttons
TUT:
Text To Binary And Binary To Text Application. I was bored, so i made a tutorial on a converter that converts text to those 0's and 1's and convert those 0's and 1's to text, and it is not encryption software, a computer runs on 0's and 1's
Text To Binary Or Button1:
Dim Val As String = Nothing
Dim Result As New System.Text.StringBuilder
For Each Character As Byte In System.Text.ASCIIEncoding.ASCII.GetBytes (TextBox1.Text)
Result.Append(Convert.ToString(Character , 2).PadLeft(8, "0"))
Result.Append(" ")
Next
Val = Result.ToString.Substring(0, Result.ToString.Length - 1)
TextBox2.Text = Val
Binary To Text Or Button2:
Dim Val As String = Nothing
Dim Characters As String = System.Text.RegularExpressions.Regex.Rep lace(TextBox1.Text, "[^01]", "")
Dim ByteArray((Characters.Length / 8) - 1) As Byte
For Index As Integer = 0 To ByteArray.Length - 1
ByteArray(Index) = Convert.ToByte(Characters.Substring(Inde x * 8, 8), 2)
Next
Val = System.Text.ASCIIEncoding.ASCII.GetStrin g(ByteArray)
TextBox2.Text = Val