Encrypt and Decrypt Querystring ASP.NET
The Below method is used to encrypt the query string in to byte..
public string Encode(string QueryStringData)
{
byte[] EncodeData
= System.Text.ASCIIEncoding.ASCII.GetBytes(QueryStringData);
string Value
= System.Convert.ToBase64String(EncodeData);
return Value;
}
The Below method is used to decrypt the query string in to its original state.
public String Decode(string QueryStringData)
{
byte[] DecodeData = System.Convert.FromBase64String(QueryStringData);
string Value =
System.Text.ASCIIEncoding.ASCII.GetString(DecodeData);
return Value;
}
Go To Part 1
No comments:
Post a Comment