public static string Base64Encode(string data) {
byte[] myBytes = Encoding.ASCII.GetBytes(data.Trim().ToCharArray());
return Convert.ToBase64String (myBytes);
}
public static string Base64Decode(string data) {
try {
return Encoding.ASCII.GetString (Convert.FromBase64String (data.Trim()));
} catch {
// Invalid String!
return "";
}
}
"Kuldeep" wrote:
> Hi All,
>
> Could you please give me some guidelines on dealing with
> Base64 encoded string.
> The actual purpose is to decode Base64 Encoded string
> and stream the data to a browser so that it can be viewed
> in a web application
>
> Regards,
> Kuldeep
>
>
>
|