| | |
| | | /// <returns></returns>
|
| | | public static string EncryptPassword(string keys, string strPsw)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (strPsw == string.Empty)
|
| | | {
|
| | | return strPsw;
|
| | |
| | | {
|
| | | ret.AppendFormat("{0:X2}", b);
|
| | | }
|
| | | return ret.ToString();
|
| | | return ret.ToString().ToLower();
|
| | | }
|
| | | catch { return strPsw; }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="strPsw"></param>
|
| | | /// <returns></returns>
|
| | | public static string DecryptPassword(string keys, string strPsw)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (strPsw == string.Empty)
|
| | | {
|
| | |
| | |
|
| | | return System.Text.Encoding.Default.GetString(ms.ToArray());
|
| | | }
|
| | | catch { return strPsw; }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 文件保存和读取_____________________
|