代码如下:

imports system.web.Security

Public Class md
    Public Function mdaccess(ByVal password As String, ByVal mdx As String) As String
        mdaccess = FormsAuthentication.HashPasswordForStoringInConfigFile(password, mdx)
    End Function
End Class

这个函数的参数部份里password就是用户的原始密码,mdx是给出的加密算法的参数,这里只能有两个值,"MD5"和"SHA1",也就是这两种加密算法了.至于这个怎么用,不用多说了,就是为了把加密后的密码存入数据库,这样增加安全性,在对比密码时可对用户的输入密码进行同样的加密后再和数据库里的密文进行比较.

相关文章:

  • 2021-10-15
  • 2021-08-18
  • 2022-02-15
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-11-19
  • 2021-08-25
  • 2022-12-23
相关资源
相似解决方案