I was doing a log in mechanism on project where i required Encryption and Decryption code
Here is the simplest method i found:
private string Encryptdata(string password)
{
string strmsg = string.Empty;
byte[] encode = new byte[password.Length];
encode = Encoding.UTF8.GetBytes(password);
strmsg = Convert.ToBase64String(encode);
return strmsg;
}
private string Decryptdata(string encryptpwd)
{
string decryptpwd = string.Empty;
UTF8Encoding encodepwd = new UTF8Encoding();
Decoder Decode = encodepwd.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(encryptpwd);
int charCount = Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
char[] decoded_char = new char[charCount];
Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
decryptpwd = new String(decoded_char);
return decryptpwd;
}
Original Source : http://www.aspdotnet-suresh.com/2010/12/introduction-here-i-will-explain-how-to_28.html
Thursday 28 August 2014
Wednesday 27 August 2014
Binding / concatenating a string literal with eval
Recently i have a requirement where i have to bind an anchor tag with two parameters in repeater. I have search for few time and then one of my friend suggest me the following solution
<a href='<%#string.Concat(siteURL,Convert.ToString(DataBinder.Eval(Container.DataItem,"TargetURL"))) %>'
<%# Container.ItemIndex==0?"class=\"fc\"":string.Empty %>><%#DataBinder.Eval(Container.DataItem,"Title") %>
</a>
<a href='<%#string.Concat(siteURL,Convert.ToString(DataBinder.Eval(Container.DataItem,"TargetURL"))) %>'
<%# Container.ItemIndex==0?"class=\"fc\"":string.Empty %>><%#DataBinder.Eval(Container.DataItem,"Title") %>
</a>
Subscribe to:
Posts (Atom)
-
In last blog we learn how can we enable footer on SharePoint Online Modern Communication site. If you have not gone through that you can use...
-
One of our client wanted to show Employee Directory and our first suggestion was to build custom SPFx which will fetch data from Azure AD or...
-
Recently I was working on sending mail using smtp server where I stuck on below error: IIS/SMTP - emails are stuck in mailroot/Queue ...