C#我记得带个函数,进行MD5加密的,哪位大哥告诉我怎么用?顺便告诉我怎么给别人加分.万分感谢.Q536823,加Q教我也行..

解决方案 »

  1.   

    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassWord.Text,"MD5");
      

  2.   

    label3.Text = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(textBox1.Text,"MD5");
      

  3.   

    http://msdn2.microsoft.com/zh-cn/library/system.security.cryptography.md5(VS.80).aspx加分点贴子上方的“管理”..
      

  4.   

    byte[] buffer1 = Encoding.UTF8.GetBytes(CryptText);
          MD5 md1 = MD5.Create();
    string sjiami = BitConverter.ToString(md1.ComputeHash(buffer1));
      

  5.   

    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("加密字符串","MD5").Substring(8, 16);
      

  6.   

    label3.Text = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(textBox1.Text,"MD5");http://msdn2.microsoft.com/zh-cn/library/system.security.cryptography.md5(VS.80).aspx
      

  7.   

    学习中.ASP.NET(C#)学习交流QQ群号:32801051
      

  8.   

    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassWord.Text,"MD5");上解
      

  9.   

    直接给你源代码,说多了怕你理解不清爽 :)
    function TForm_SetWebSuPassword.GetMd5String(strIn: string): string;
    var
      MyMD5:MD5CryptoServiceProvider;
    begin
      MyMD5:=MD5CryptoServiceProvider.Create();
      result:=BitConverter.ToString(MyMD5.ComputeHash(Encoding.Default.GetBytes(strIn))).Replace('-','').ToLower();
    end;
      

  10.   

    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(ss, "MD5")
      

  11.   

    public string Md5Str(string str)
        {
            string temp = "";
            if (str != "")
            {
                temp = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
                temp = temp.Substring(0,8).ToLower();
            }
            return temp;
        }
      

  12.   

    System.Security.Cryptography.MD5CryptoServiceProvider名称空间
     
    byte[] data = new byte[DATA_SIZE];
    // This is one implementation of the abstract class MD5.
    MD5 md5 = new MD5CryptoServiceProvider();
    byte[] result = md5.ComputeHash(data);
      

  13.   

    public static string MD5(string inputString)
            {
                //MD5加密字符串
                MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
                byte[] encryptedBytes = md5.ComputeHash(Encoding.Unicode.GetBytes(inputString));
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                for (int i = 0; i < encryptedBytes.Length; i++)
                {
                    sb.AppendFormat("{0:x2}", encryptedBytes[i]);
                }
                return sb.ToString();
            }
      

  14.   

    看这个:
    using System;
    using System.Security.Cryptography;
    using System.Text;class Example
    {    static string getMd5Hash(string input)
        {
            MD5 md5Hasher = MD5.Create();        byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));        StringBuilder sBuilder = new StringBuilder();        for (int i = 0; i < data.Length; i++)
            {
                sBuilder.Append(data[i].ToString("x2"));
            }        return sBuilder.ToString();
        }    static bool verifyMd5Hash(string input, string hash)
        {
            string hashOfInput = getMd5Hash(input);        StringComparer comparer = StringComparer.OrdinalIgnoreCase;        if (0 == comparer.Compare(hashOfInput, hash))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        static void Main()
        {
            string source = "Hello World!";
            
            string hash = getMd5Hash(source);        Console.WriteLine("The MD5 hash of " + source + " is: " + hash + ".");        Console.WriteLine("Verifying the hash...");        if (verifyMd5Hash(source, hash))
            {
                Console.WriteLine("The hashes are the same.");
            }
            else
            {
                Console.WriteLine("The hashes are not same.");
            }
            
        }
    }
      

  15.   

    最简单的
    label.Text = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(textBox1.Text,"MD5");
      

  16.   

    参见我的博客文章《常用的加密方式》
    http://www.cnblogs.com/heekui/archive/2007/02/14/650290.html
      

  17.   

    public static string EncryptString(string pwd)
            {
                return FormsAuthentication.HashPasswordForStoringInConfigFile (pwd, "MD5");
            }
      

  18.   

    System.Security.Cryptography.MD5 类
      

  19.   

    俺给你一个。
    public static string MD5(string inputString)
            {            
                MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
                byte[] encryptedBytes = md5.ComputeHash(Encoding.Unicode.GetBytes(inputString));            
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                for (int i = 0; i < encryptedBytes.Length; i++)
                {
                    sb.AppendFormat("{0:x2}", encryptedBytes[i]);
                }
                return sb.ToString();
            }