WinForm MD5加密,校验是否加密过,

 

MD5加密方法:

/// <summary>

/// MD5加密
/// </summary>
/// <param name="myString">加密文本</param>
/// <returns>密文</returns>
public static string Md5(string myString)
{
return FormsAuthentication.HashPasswordForStoringInConfigFile(myString, "MD5");
}

 


/// <summary>
/// 判断是否加密过
/// </summary>
/// <param name="mystring"></param>
/// <returns></returns>
public static bool IsEncryption(string mystring)
{
bool result;
if (mystring.Length==32)
{
result = true;
}
else
{
result = false;
}
return result;
}

posted @ 2022-02-28 14:47  KevinSteven  阅读(68)  评论(0编辑  收藏  举报