Does anybody have sample code to convert from binary data to string in c#?
Sounds like you just need to decode the binary data. Therefore you need an encoding (like utf-8 or unicode).
Example:
var textFromBinary = System.Text.Encoding.UTF8.GetString(myBinaryData);
If your binary data is stored in byte
array and you want to convert it to Base64-encoding, you can use Convert.ToBase64String
method:
var base64String = Convert.ToBase64String(yourBinaryDataHere);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With