可能重复:结果 Binary为了对应的ASCII字符串转换
我之前发布了slimier的问题,但没有得到一个正确的答案。
我的问题是,我有一个二进制字符串作为
00100000011101110110000101101110011101000010000001110100011011110010000001100100011011110111这需要即时通讯转换为普通的ASCII字符串文本
我用 BinaryReader 和阅读并设有code System.Text.ASCIIEncoding.ASCII ,但即时得到同样 0101010 字符串
字节[]字节组= b.ReadBytes((int)的长度); System.Text.Encoding encEn codeR = System.Text.ASCIIEncoding.ASCII; 字符串BB = encEn coder.GetString(ByteArray的);任何帮助将不胜感激!
解决方案首先转换二进制字符串转换为字节[] 使用How我可以带code 1和0运输的字符串?
接下来使用 Convert.ToBase64String 方法得到实际 System.String
Possible Duplicate: Binary To Corresponding ASCII String Conversion
I posted a slimier question before but didn't got a correct answer..
my problem is i have a binary string as
00100000011101110110000101101110011101000010000001110100011011110010000001100100011011110111Which im required to convert to "Normal ASCII String Text"
I used BinaryReader and read and encode System.Text.ASCIIEncoding.ASCII but im getting the same 0101010 string
byte[] bytearray = b.ReadBytes((int)length); System.Text.Encoding encEncoder = System.Text.ASCIIEncoding.ASCII; string bb = encEncoder.GetString(bytearray);any help will be grateful !
解决方案first translate the binary string into a byte[] using How could I encode a string of 1s and 0s for transport?
next use the Convert.ToBase64String method to get the actual System.String
更多推荐
二进制字符串ASCII文本字符串
发布评论