'バイナリ→文字列変換 Dim bin() As Byte = System.IO.File.ReadAllBytes("C:\WINDOWS\system32\calc.exe") Dim hexText As String = BitConverter.ToString(bin) '文字列→バイナリ復元 Dim bin2() As Byte = Array.ConvertAll(Split(hexText, "-"), Function(s) Convert.ToByte(s, 16))
'バイナリ→文字列変換 Dim bin() As Byte = System.IO.File.ReadAllBytes("C:\WINDOWS\system32\calc.exe") Dim base64 As String = Convert.ToBase64String(bin) '文字列→バイナリ復元 Dim bin2() As Byte = Convert.FromBase64String(base64)