Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Silly excersise
Message
 
To
17/02/2011 06:01:57
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01500484
Message ID:
01500487
Views:
68
>Try http://www.tek-tips.com/faqs.cfm?fid=4461
>
>>Hi All, just messing around - not a work thing - if I have a string of binary digits such as
>>
>>
>>string s = "0101000001000101010101000100010101010010"
>>
>>
>>how do I convert it to text ?, all the Convert.* methods I've looked at require a byte[] array as an arg and I don't know how to create one !

Hi Neil, I wanted a c# solution but ! this is what I've tried so far - the binary string s1 represents "PETER"
// if I do this
UTF8Encoding enc = new UTF8Encoding;
string s1 = "0101000001000101010101000100010101010010";

byte[] b = enc.GetBytes(s1);
string s2 = Convert.ToBase64String(b);

// The contents of s2 is "MDEwMTA...and so on" and 60 chars in length.
any ideas ?
Regards,
Peter J. Kane



Pete
Previous
Reply
Map
View

Click here to load this message in the networking platform