0

I have to get the value from byte string this is the byte string

4W3CfJ//nw1CpeA5NfXx9Ia32JyVmgpRrQCzUabFUvv0fqXYLVeNBT6XKjBehFNGtQ3Sng3Zucqu+RcXUzJ3KA==

now how can I get the value from it

4 Answers 4

6

Its an Base64 Encoded string you will need to get back the UnEncoded string like this:

 byte[] b = Convert.FromBase64String("your base 64 string==");

 originalString = System.Text.Encoding.UTF8.GetString(b);
Sign up to request clarification or add additional context in comments.

Comments

2

Use

Byte[] bytes = Convert.FromBase64String(myString);

Comments

0

Look into encoding, but it might be as simple as

YourString = Encoding.ASCII.GetBytes( YourByteArrayString );

Comments

0

If the byte array is an UTF encoded byte array it can be converted using

UTF8Encoding encoder = new UTF8Encoding(); 
encoder.GetString(bytes);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.