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
I tested it. The code for Button 1 is OK. There are many errors in the source code for Button 2
Originally Posted by randomhacker
I tested it. The code for Button 1 is OK. There are many errors in the source code for Button 2
? Pm me i can help u
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
ok it works no errors but what does button 2 do if it turns the text back to normal it doesn't work for me please help.
Originally Posted by trevor206
ok it works no errors but what does button 2 do if it turns the text back to normal it doesn't work for me please help.
ok so make 2 textboxes and when u get the binary numbers put those into textbox 1 and press button2 and i should translate back to normal words
The error I got for Binary to Text or Button 2 is 'Name "Characters" is not declared'.
EDIT: I got it working... No worries
use [ code] [/ code] or [ php] [ /php] it makes it easier to read