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

📄 frmeditpw.frm

📁 网上收集的一个考试管理系统。带论文的
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmEditPW 
   Caption         =   "修改密码"
   ClientHeight    =   2790
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3915
   Icon            =   "FrmEditPW.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   2790
   ScaleWidth      =   3915
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame2 
      Height          =   2760
      Left            =   45
      TabIndex        =   0
      Top             =   0
      Width           =   3840
      Begin VB.TextBox Text1 
         Height          =   330
         Index           =   0
         Left            =   1080
         TabIndex        =   6
         Top             =   270
         Width           =   2400
      End
      Begin VB.TextBox Text1 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Index           =   1
         Left            =   1080
         PasswordChar    =   "*"
         TabIndex        =   5
         Top             =   720
         Width           =   2400
      End
      Begin VB.TextBox Text1 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Index           =   2
         Left            =   1080
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   1170
         Width           =   2400
      End
      Begin VB.TextBox Text1 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Index           =   3
         Left            =   1080
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   1620
         Width           =   2400
      End
      Begin VB.CommandButton Command2 
         Caption         =   "更改[&E]"
         Height          =   375
         Index           =   0
         Left            =   1485
         TabIndex        =   2
         Top             =   2160
         Width           =   915
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取消[&C]"
         Height          =   375
         Index           =   1
         Left            =   2565
         TabIndex        =   1
         Top             =   2160
         Width           =   915
      End
      Begin VB.Label Label2 
         Caption         =   "用户名:"
         Height          =   375
         Index           =   0
         Left            =   180
         TabIndex        =   10
         Top             =   315
         Width           =   1050
      End
      Begin VB.Label Label2 
         Caption         =   "原始密码:"
         Height          =   375
         Index           =   1
         Left            =   180
         TabIndex        =   9
         Top             =   765
         Width           =   1050
      End
      Begin VB.Label Label2 
         Caption         =   "新密码:"
         Height          =   375
         Index           =   2
         Left            =   180
         TabIndex        =   8
         Top             =   1215
         Width           =   1050
      End
      Begin VB.Label Label2 
         Caption         =   "确认密码:"
         Height          =   375
         Index           =   3
         Left            =   180
         TabIndex        =   7
         Top             =   1665
         Width           =   1050
      End
   End
End
Attribute VB_Name = "FrmEditPW"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Rs As ADODB.Recordset
Private Sub Command2_Click(Index As Integer)
Dim Msg$
Dim SQL$
Select Case Index
       Case 0
            If Text1(0).Text = Empty Then
                MsgBox "请输入用户名", vbInformation, "操作失败"
                Text1(0).SetFocus
                Exit Sub
            End If
            
            If Text1(1).Text = Empty Then
                MsgBox "请输入原始密码", vbInformation, "操作失败"
                Text1(1).SetFocus
                Exit Sub
            End If
            If Text1(2).Text = Empty Then
                MsgBox "请输入新密码", vbInformation, "操作失败"
                Text1(2).SetFocus
                Exit Sub
            End If
            If Text1(3).Text = Empty Then
                MsgBox "请输入确认密码", vbInformation, "操作失败"
                Text1(3).SetFocus
                Exit Sub
            End If
            If Text1(2).Text <> Text1(3).Text Then
                MsgBox "新密码与确认密码不一致", vbInformation, "操作失败"
                Text1(1).SetFocus
                Exit Sub
            End If
            
            DBName = UserDB
            SQL = "select * from UserInfo where UserName='" & Text1(0).Text & "'"

            Set Rs = executeSQL(SQL, Msg, DBName)
            If Msg = "查询正确" Then
                If Text1(1).Text = JieMi(Rs.Fields(1), Text1(0).Text) Then
                      
                       Rs.Fields(1) = JiaMi(Text1(2).Text, Text1(0).Text)
                       Rs.Update
                       Set Rs = Nothing
                       MsgBox "密码修改成功", vbInformation, "提示 "
                       Unload Me
                       Exit Sub

                 Else
                      MsgBox "原密码不正确,请重新输入", vbInformation, "操作失败"
                 End If
            Else
               MsgBox "没有此用户,无法修改", vbInformation, "操作失败"
            End If
             Set Rs = Nothing
       Case 1
            Unload Me
End Select

End Sub

Private Sub Form_Load()
Text1(0).Text = UserName
End Sub

⌨️ 快捷键说明

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