i) The FromBase64String() converts the string to a byte array
ii) Use the relevant Encoding method to convert the byte array to a
string, in our case UTF8.GetString();
string str="Hello World";
string str1="";
byte[] byt = System.Text.Encoding.UTF8.GetBytes(str);
// convert the byte array to a Base64 string
str1 = Convert.ToBase64String(byt);
Now convert Convert Base64 string to Original String
byte[] b = Convert.FromBase64String(str1);
str = System.Text.Encoding.UTF8.GetString(b);
0 comments:
Post a Comment