📄 frmpassword.frm
字号:
VERSION 5.00
Begin VB.Form frmPassword
BorderStyle = 3 'Fixed Dialog
Caption = "修改登陆密码"
ClientHeight = 2385
ClientLeft = 45
ClientTop = 330
ClientWidth = 3510
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2385
ScaleWidth = 3510
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Appearance = 0 'Flat
ForeColor = &H80000008&
Height = 150
Left = 60
TabIndex = 6
Top = 1635
Width = 3390
End
Begin VB.CommandButton cmdClose
Caption = "关 闭"
Height = 375
Left = 1845
TabIndex = 5
Top = 1875
Width = 1035
End
Begin VB.CommandButton cmdUpdate
Caption = "确 定"
Height = 375
Left = 555
TabIndex = 4
Top = 1875
Width = 1035
End
Begin VB.TextBox Text4
Height = 315
IMEMode = 3 'DISABLE
Left = 1350
MaxLength = 6
PasswordChar = "*"
TabIndex = 3
Top = 1305
Width = 1620
End
Begin VB.TextBox Text3
Height = 315
IMEMode = 3 'DISABLE
Left = 1350
MaxLength = 6
PasswordChar = "*"
TabIndex = 2
Top = 900
Width = 1620
End
Begin VB.TextBox Text2
Height = 315
IMEMode = 3 'DISABLE
Left = 1350
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 1620
End
Begin VB.TextBox Text1
Height = 315
Left = 1350
MaxLength = 4
TabIndex = 0
Top = 75
Width = 1620
End
Begin VB.Label Label4
Caption = "密码确认"
Height = 360
Left = 480
TabIndex = 10
Top = 1365
Width = 945
End
Begin VB.Label Label3
Caption = "新 密 码"
Height = 360
Left = 480
TabIndex = 9
Top = 960
Width = 945
End
Begin VB.Label Label2
Caption = "原 密 码"
Height = 360
Left = 480
TabIndex = 8
Top = 540
Width = 945
End
Begin VB.Label Label1
Caption = "用户代码"
Height = 360
Left = 480
TabIndex = 7
Top = 150
Width = 945
End
End
Attribute VB_Name = "frmPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdUpdate_Click()
Dim rs As New ADODB.Recordset
If Text1 = "" Then
MsgBox "用户代码不可为空!", vbInformation, "系统提示"
Text1.SetFocus
Exit Sub
ElseIf Trim(Text3) <> Trim(Text4) Then
MsgBox "两次密码不一致、请确认密码是否正确!", vbInformation, "系统提示"
Exit Sub
End If
If rs.State = 1 Then rs.Close
rs.Open "select * from T_用户表 where 登陆号码='" & Trim(Text1.Text) & "' and 密码='" & Trim(Text2.Text) & "'", gCnn, adOpenStatic, adLockOptimistic
If rs.RecordCount = 1 Then
gCnn.Execute "update T_用户表 set 密码='" & Trim(Text3.Text) & "' where 登陆号码='" & Text1 & "'"
MsgBox "修改密码成功,您的新密码是【" & Text3.Text & "】", vbInformation, "系统提示"
Unload Me
Set rs = Nothing
Exit Sub
Else
MsgBox "用户名或代码错误!", vbInformation, "系统提示"
Text1.SetFocus
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{Tab}"
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{Tab}"
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{Tab}"
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{Tab}"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -