Step1: Decrypt password
string encryptpwd = "";
foreach(User u in logUserDetails)
{
encryptpwd = u.Password;
}
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);
Step2: Encrypt password
byte[] encData_byte = new byte[user.Password.Length];
encData_byte = System.Text.Encoding.UTF8.GetBytes(user.Password);
string encodedData = Convert.ToBase64String(encData_byte);
user.Password = encodedData;
Is this for NAV or something else ? or Just for Information
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148