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

📄 frmmodifyupwd.vb

📁 采用VB编写的机房管理系统
💻 VB
字号:
Public Class FrmModifyUPwd
    Inherits System.Windows.Forms.Form

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

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents TxtIDOrder As System.Windows.Forms.TextBox
    Friend WithEvents TxtPassword As System.Windows.Forms.TextBox
    Friend WithEvents BtOK As System.Windows.Forms.Button
    Friend WithEvents BtCancel As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label
        Me.TxtIDOrder = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.TxtPassword = New System.Windows.Forms.TextBox
        Me.BtOK = New System.Windows.Forms.Button
        Me.BtCancel = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(40, 32)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 24)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "编号"
        '
        'TxtIDOrder
        '
        Me.TxtIDOrder.Location = New System.Drawing.Point(120, 24)
        Me.TxtIDOrder.Name = "TxtIDOrder"
        Me.TxtIDOrder.Size = New System.Drawing.Size(144, 21)
        Me.TxtIDOrder.TabIndex = 1
        Me.TxtIDOrder.Text = ""
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(40, 88)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(56, 24)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "密码"
        '
        'TxtPassword
        '
        Me.TxtPassword.Location = New System.Drawing.Point(120, 80)
        Me.TxtPassword.Name = "TxtPassword"
        Me.TxtPassword.Size = New System.Drawing.Size(144, 21)
        Me.TxtPassword.TabIndex = 3
        Me.TxtPassword.Text = ""
        '
        'BtOK
        '
        Me.BtOK.Location = New System.Drawing.Point(64, 152)
        Me.BtOK.Name = "BtOK"
        Me.BtOK.Size = New System.Drawing.Size(80, 32)
        Me.BtOK.TabIndex = 4
        Me.BtOK.Text = "确定"
        '
        'BtCancel
        '
        Me.BtCancel.Location = New System.Drawing.Point(192, 152)
        Me.BtCancel.Name = "BtCancel"
        Me.BtCancel.Size = New System.Drawing.Size(72, 32)
        Me.BtCancel.TabIndex = 5
        Me.BtCancel.Text = "取消"
        '
        'FrmModifyUPwd
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(304, 238)
        Me.Controls.Add(Me.BtCancel)
        Me.Controls.Add(Me.BtOK)
        Me.Controls.Add(Me.TxtPassword)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.TxtIDOrder)
        Me.Controls.Add(Me.Label1)
        Me.MaximizeBox = False
        Me.Name = "FrmModifyUPwd"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "修改用户密码"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub BtCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtCancel.Click
        Me.Finalize()
    End Sub

    Private Sub FrmModifyUPwd_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub BtOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtOK.Click
        If Trim(TxtIDOrder.Text) = "" Then
            MsgBox("输入的密码不能为空!", MsgBoxStyle.Exclamation, Me.Text)
            Exit Sub
        End If




        If Trim(TxtPassword.Text) = "" Then
            MsgBox("输入的密码不能为空!", MsgBoxStyle.Exclamation, Me.Text)
            Exit Sub
        End If
        Dim oleconn As New OleDb.OleDbConnection(CONN)

        Dim SQLString As String
        Dim flag As Integer

        SQLString = "select * from tbUser where IDOrder='" & Trim(TxtIDOrder.Text) & "'"

        Dim cmd As New OleDb.OleDbCommand(SQLString, oleconn)
        oleconn.Open()


        flag = Val(cmd.ExecuteNonQuery)
        If flag <> 0 Then
            MsgBox("", MsgBoxStyle.Exclamation, Me.Text)
            Exit Sub
        End If

        SQLString = "update tbUser set Pwd='" & Trim(TxtPassword.Text) & "' where IDOrder='" & Trim(TxtIDOrder.Text) & "'"
        CommandRecord(SQLString)
        MsgBox("密码修改成功!", , Me.Text)
        oleconn.Close()

        Me.Dispose()


    End Sub
End Class

⌨️ 快捷键说明

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