⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findpwd.aspx.vb

📁 用户登录新闻发布系统
💻 VB
字号:
'C:\Program Files\Windows NT\hypertrm.exe
Imports System.Data.SqlClient
Public Class findpwd
    Inherits System.Web.UI.Page

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents t1 As System.Web.UI.WebControls.TextBox
    Protected WithEvents Label2 As System.Web.UI.WebControls.Label
    Protected WithEvents t2 As System.Web.UI.WebControls.TextBox
    Protected WithEvents Label3 As System.Web.UI.WebControls.Label
    Protected WithEvents b1 As System.Web.UI.WebControls.Button
    Protected WithEvents b2 As System.Web.UI.WebControls.Button
    Protected WithEvents h1 As System.Web.UI.WebControls.HyperLink
    Protected WithEvents l4 As System.Web.UI.WebControls.Label
    Protected WithEvents l2 As System.Web.UI.WebControls.Label
    Protected WithEvents l1 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

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
    End Sub

    Private Sub b2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b2.Click
        t1.Text = ""
        t2.Text = ""
    End Sub

    Private Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.Click
        Dim sqlstr As String = "server=cs007;uid=sa;pwd=;database=tt"
        Dim conn As New SqlConnection(sqlstr)
        Dim comm As New SqlCommand
        Dim comm2 As New SqlCommand

        If t1.Text = "" Or t2.Text = "" Then
        Else
            conn.Open()
            comm = New SqlCommand("select * from admin where username = '" & t1.Text & "'and email='" & t2.Text & "'", conn)
            Dim sqlread As SqlDataReader = comm.ExecuteReader
            If sqlread.Read Then
                conn.Close()
                comm2 = New SqlCommand("select userpws from admin where username='" & t1.Text & "' and email='" & t2.Text & "'", conn)
                Dim pwd As String
                conn.Open()
                Dim sqlread2 As SqlDataReader = comm2.ExecuteReader
                sqlread2.Read()
                pwd = sqlread2("userpws")
                l1.Text = pwd
                l1.Visible = True
                l2.Visible = True
                l4.Visible = False
                conn.Close()
            Else
                l4.Visible = True
                t1.Text = ""
                t2.Text = ""
                l1.Visible = False
            End If
            conn.Close()
        End If
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -