md5加密数据

来源:互联网 发布:什么软件招人快 编辑:程序博客网 时间:2024/05/16 08:34

      Dim md5Hasher as New MD5CryptoServiceProvider()
   
      Dim hashedBytes as Byte()  
      Dim encoder as New UTF8Encoding()

      hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(txtPwd.Text))     

      Dim paramPwd as SqlParameter
      paramPwd = New SqlParameter("@Password", SqlDbType.Binary, 16)
      paramPwd.Value = hashedBytes
      objCmd.Parameters.Add(paramPwd)