请问各位在winform中想用MD5需要引入哪个命名空间呢?

解决方案 »

  1.   

    System.Security.Cryptography.MD5
             System.Security.Cryptography.MD5CryptoServiceProvider
      

  2.   

    using System.Security.Cryptography;System.Security.Cryptography.MD5 md=new MD5();
    ...using 只能导入命名空间
    而md5是一个类,所以导入时会出错!
      

  3.   

    请把步骤写全点好吗?我第1次用winform,不是很理解!
      

  4.   

    先导入
    using System.Security.Cryptography; 
    然后在定义
    System.Security.Cryptography.MD5CryptoServiceProvider _md5 = new MD5CryptoServiceProvider();
    byte[] _t1 = _md5.ComputeHash(System.Text.Encoding.Default.GetBytes(this.textBox3.Text));
    string _strT1 = BitConverter.ToString(_t1);
    byte[] _t2 = _md5.ComputeHash(System.Text.Encoding.Default.GetBytes(this.textBox4.Text));
    string _strT2 = BitConverter.ToString(_t2);
    if(_strT1==_strT2)
    {
    MessageBox.Show("OK");
    }
    else
    {
    MessageBox.Show("No");
    }