/// <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 阅读(323) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜