button 1
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 b
button 2
Dim Val As String = Nothing
Dim Characters As String = System.Text.RegularExpressions.Regex.Replace(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(Index * 8, 8), 2)
Next
Val = System.Text.ASCIIEncoding.ASCII.GetString(ByteArray)
TextBox2.Text = Val
if the code is in one line and is not set out right then goto this site [ Ссылка ] and go to the visual basic tab and goto the one that has the name "how to make a visual basic text to binary code converter" and copy in the code it should work if you have anny problems just ask and i will help you with it and this may be the same for any of our other visual basic codes. please do us a favor go on our website and click on the ads we thank you for your support
![](https://i.ytimg.com/vi/LYI_-yg_yJ0/mqdefault.jpg)