小弟我做到后台,想用MD5加密技术对密码进行一下加密!
可是在网上找了许多都是C#的,那位好心人对我说一下VB#下的代码呀!
谢谢了!

解决方案 »

  1.   

    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("要做的加密", "MD5").ToLower()
      

  2.   

    dim str as string = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("要做的加密", "MD5").ToLower() 
      

  3.   


    Dim name, pwd As String
            Dim constr As String
            Dim comd As SqlCommand
            Dim objconn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
            Dim str As String = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("userpwd", "MD5").ToLower()
            If Page.IsValid Then
                name = TextBox1.Text
                pwd = TextBox2.Text
                constr = "select * from new where(username='" & name & "')and(userpwd='" & pwd & " ')"
                comd = New SqlCommand(constr, objconn)            objconn.Open()
                Dim prord As SqlDataReader
                prord = comd.ExecuteReader()
                If Not prord.Read() Then
                    Response.Write("<script LANGUAGE='javascript'>alert('对不起,登录失败!请输入正确的用户名和密码');history.go(-1);</script>")
                    TextBox1.Text = ""
                    TextBox2.Text = ""
                Else
                    Session("username") = name
                    Session("password") = pwd
                    Session.Timeout = 30当我把他放进时!不行!没有加密!
    但是只有你一人这么认真的回答我问题!这分还是给你了!