📄 alreadyland.aspx.vb
字号:
Imports System.Data
Imports System.Data.SqlClient
Public Class alreadyland
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents t1 As System.Web.UI.WebControls.TextBox
Protected WithEvents t2 As System.Web.UI.WebControls.TextBox
Protected WithEvents t3 As System.Web.UI.WebControls.TextBox
Protected WithEvents l1 As System.Web.UI.WebControls.Label
Protected WithEvents l2 As System.Web.UI.WebControls.Label
Protected WithEvents l3 As System.Web.UI.WebControls.Label
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents l4 As System.Web.UI.WebControls.Label
Protected WithEvents l5 As System.Web.UI.WebControls.Label
Protected WithEvents b1 As System.Web.UI.WebControls.Button
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents l6 As System.Web.UI.WebControls.Label
Protected WithEvents l7 As System.Web.UI.WebControls.Label
Protected WithEvents l12 As System.Web.UI.WebControls.Label
Protected WithEvents l13 As System.Web.UI.WebControls.Label
Protected WithEvents l14 As System.Web.UI.WebControls.Label
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
'注意: 以下占位符声明是 Web 窗体设计器所必需的。
'不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Dim sqlstr As String = "server=cs007;uid=sa;pwd=;database=tt"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub fh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Response.Redirect("webform1.asp")
End Sub
Private Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.Click
l4.Visible = False
l5.Visible = False
l6.Visible = False
l12.Visible = True
l13.Visible = True
l14.Visible = True
If t1.Text = "" Or t2.Text = "" Or t3.Text = "" Then
Else
change()
End If
End Sub
Sub change()
Dim tt4 As String
tt4 = Session("username")
Dim conn As New SqlConnection(sqlstr)
Dim comm As SqlCommand
conn.Open()
comm = New SqlCommand("select * from admin where username='" & tt4 & "'and userpws='" & t1.Text & "'", conn)
Dim commread As SqlDataReader
commread = comm.ExecuteReader
If commread.Read Then
conn.Close()
If t1.Text = t2.Text Then
t1.Text = ""
t2.Text = ""
t3.Text = ""
l6.Visible = True
Else
If t3.Text = t2.Text Then
conn.Open()
Dim comm2 As SqlCommand
Dim comm3 As SqlCommand
comm2 = New SqlCommand("update admin set userpws='" & t2.Text & "' where username='" & tt4 & " 'and userpws= '" & t1.Text & "'", conn)
comm3 = New SqlCommand("update admin set tingliu=0 where username='" & tt4 & " 'and userpws= '" & t2.Text & "'", conn)
comm2.ExecuteNonQuery()
comm3.ExecuteNonQuery()
Me.Response.Redirect("modificationuser.aspx")
conn.Close()
Else
l5.Visible = True
t1.Text = ""
t2.Text = ""
t3.Text = ""
End If
End If
Else
conn.Close()
l6.Visible = False
l4.Visible = True
l5.Visible = False
t2.Text = ""
t3.Text = ""
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -