您现在的位置: 365建站网 > 365文章 > MD5加密算法

MD5加密算法

文章来源:365jz.com 点击数:172 更新时间:2009-09-16 11:57

 

           
       
       记住不要忘记命名空间的引用:

        using System.Security.Cryptography;
         
        public string PwdEncrypt(string pwd) // MD5加密密码.....

        {
            MD5 md5 = new MD5CryptoServiceProvider();
            byte[] data = System.Text.Encoding.Default.GetBytes(pwd);
            byte[] md5data = md5.ComputeHash(data);

            md5.Clear();
            string Str = "";
            for (int i = 0; i < md5data.Length - 1; i++)
            {
                Str += md5data[i].ToString("x").PadLeft(2, '0');
            }
            return Str;
        }

生产内容,同时打通搜索引擎(SEO)与AI搜索引擎(GEO)流量入口的软件! 点击进入365建站器 »

您可能感兴趣的文章