Dim bin() As Byte = Array.ConvertAll(Of Char, Byte)(TextBox1.Text, AddressOf Convert.ToByte)
Private Function ToBinary(ByVal s As String) As Byte() Dim b As New List(Of Byte)() For I As Integer = 1 To Len(s) Step 2 b.Add(CByte(Mid(s, I, 2))) Next Return b.ToArray() End Function
Private Function ToBinary(ByVal s As String) As Byte() Dim b As New List(Of Byte)() For I As Integer = 1 To Len(s) Step 2 b.Add(Convert.ToByte(Mid(s, I, 2), 16)) Next Return b.ToArray() End Function