/// <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;
}