就是想用 md5加密  textbox1的中数据 然后再 在 textbox2中显示------
新学 请帮忙 谢谢   请不要从 网上 抄    环境2005

解决方案 »

  1.   

     string clean = "aaa11";
                byte[] buffer  = System.Text.Encoding.ASCII.GetBytes(clean);
                System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5CryptoServiceProvider.Create();
                byte[] hash = md5.ComputeHash(buffer);
                string result = Convert.ToBase64String(hash);
                Console.WriteLine(result);
                Console.Read();
      

  2.   

    1、public static string Md5Pwd3(string pwd)
        {
    //这里你可以对pwd进行一些处理!比如说让pwd=pwd+pwd之类的东东
            return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, "MD5").ToLower();
        }2、public static string Get_MD5_Method4(string pwd)  
            {  //这里你可以对pwd进行一些处理!比如说让pwd=pwd+pwd之类的东东
                return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd,"MD5").ToLower().Substring(8,16) ;  //这里的8与16你完全可以换成0-31之间的任何一个数字 ̄ ̄substring是什么意思就不用我说了吧,可以根据自己的意思适当的换掉
            }与该方法类似
    }
      

  3.   

    去我博客有
    http://blog.csdn.net/ahshow
      

  4.   

    发个链接的
    http://blog.csdn.net/ahshow
      

  5.   

    MD5 MD5 = new MD5CryptoServiceProvider();
                            string Pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(textBox1.Text, "MD5");
                            textBox2.Text = Pwd;