📄 password.aspx.vb
字号:
Partial Class password
Inherits System.Web.UI.Page
Public pulic As New pulic1
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If IsValid Then
Dim str = "update manager set passwd='" & TextBox3.Text.Trim & "' where id='" & TextBox1.Text.Trim & "' and passwd='" & TextBox2.Text.Trim & "'"
pulic.noquery(str)
Label9.Text = "密码更改成功"
Label9.Visible = True
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label9.Visible = False
If Session("bz") = "" Then
Response.Redirect("login.aspx")
Else
TextBox1.Text = Session("managerid")
End If
End Sub
Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate
Dim str2 = "select count(*) from manager where passwd='" & TextBox2.Text.Trim & "'"
Dim count As Integer = Convert.ToInt32(pulic.Scalar(str2)) 'count中即为总数目
If (TextBox4.Text.Trim <> TextBox3.Text.Trim) Or (TextBox3.Text = "") Or (TextBox4.Text = "") Or (TextBox2.Text = "") Then
TextBox4.Text = ""
TextBox3.Text = ""
CustomValidator1.Text = "新密码输入不一致"
args.IsValid = False
Else
If count = 0 Then
CustomValidator1.Text = "旧密码输入错误"
args.IsValid = False
Else
args.IsValid = True
End If
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Response.Redirect("index.aspx")
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -