/// <summary>
/// 生成MD5加密字符串
/// </summary>
/// <param name="str"></param>
/// <param name="code"></param>
/// <returns></returns>
public static string CreateMd5(string str, int code)
{
string md5 = "";
if (code == 16)
{
md5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower
().Substring(8, 16);
}
if (code == 32)
{
md5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower();
}
return md5;
}
posted on 2010-10-18 11:22
sanmao 阅读(329)
评论(0) 编辑 收藏