数据库密码列怎么加密,access/sql2000,问题多多,分越来越少了,可怜

解决方案 »

  1.   

    public string Encrypt(string cleanString)//MD5加密
    {
        Byte[] clearBytes = new UnicodeEncoding().GetBytes(cleanString);
        Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
        return BitConverter.ToString(hashedBytes);
    }
    这个函数的参数是要加密的字符串,返回的是MD5 加密过的字符串
      

  2.   

    调用.net中的加密类就可以实现加密密码功能,具体实现看楼上给出的代码就可以
      

  3.   

    返回后,connectionstring=BitConverter.ToString(hashedBytes);就可以了吗?
      

  4.   

    using System.Web.Security;public string PassWord(string str)
    {
      return FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5");
    }请加入群13827630 ,注册论坛bbs.shoucao.cn会有想不到的收获