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
00100000011101110110000101101110011101000010000001110100011011110010000开发者_如何学运维001100100011011110111
Which 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
精彩评论