15 February 2014

How to Encoding & Decoding the string in asp.net



string  message ="adi";
string str=obj.encode(str);
str=obj.decode(str);
public string encode(string message)
    {
        return Convert.ToBase64String(Encoding.UTF8.GetBytes(message));
    }
    public string decode(string message)
    {
        return Encoding.UTF8.GetString(Convert.FromBase64String(message));
    }

No comments:

Post a Comment