📄 frmeditmima.frm
字号:
VERSION 5.00
Begin VB.Form frmeditmima
BorderStyle = 3 'Fixed Dialog
Caption = "密码修改"
ClientHeight = 4035
ClientLeft = 45
ClientTop = 405
ClientWidth = 5250
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4035
ScaleWidth = 5250
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 3135
Left = 360
TabIndex = 6
Top = 120
Width = 4215
Begin VB.TextBox oldmima
Height = 330
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 1
Top = 1132
Width = 2895
End
Begin VB.TextBox newmima
Height = 330
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 2
Top = 1852
Width = 2895
End
Begin VB.TextBox queren
Height = 330
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 3
Top = 2580
Width = 2895
End
Begin VB.ComboBox cmbcaozuoyuan
Height = 300
Left = 1080
Style = 2 'Dropdown List
TabIndex = 0
Top = 400
Width = 2895
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 375
Left = 240
TabIndex = 10
Top = 480
Width = 735
End
Begin VB.Label Label2
Caption = "旧密码:"
Height = 375
Left = 240
TabIndex = 9
Top = 1200
Width = 855
End
Begin VB.Label Label3
Caption = "新密码:"
Height = 255
Left = 240
TabIndex = 8
Top = 1920
Width = 855
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "确认码:"
Height = 180
Left = 240
TabIndex = 7
Top = 2640
Width = 720
End
End
Begin VB.CommandButton cmdok
Caption = "确定"
Height = 375
Left = 960
TabIndex = 4
Top = 3480
Width = 1095
End
Begin VB.CommandButton cmdcancel
Caption = "取消"
Height = 375
Left = 2880
TabIndex = 5
Top = 3480
Width = 1095
End
End
Attribute VB_Name = "frmeditmima"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub cmbcaozuoyuan_KeyPress(KeyAscii As Integer)
If cmbcaozuoyuan.ListIndex <> -1 And KeyAscii = 13 Then
oldmima.SetFocus
Exit Sub
End If
End Sub
Private Sub cmdok_Click()
Dim rs As New ADODB.Recordset
Dim sql As String
Dim sql1 As String
Dim ss As String
Dim username As String
Dim password As String
Dim username1 As String
Dim password1 As String
sql = "select caozuoyuan,mima from admin where caozuoyuan='" & cmbcaozuoyuan.List(cmbcaozuoyuan.ListIndex) & "'order by ID"
rs.open sql, cn, adOpenDynamic, adLockOptimistic
If Trim(newmima.Text) <> Trim(queren.Text) Then
MsgBox "两次输入的密码不一致!", 48, "信息提示"
queren.Text = ""
queren.SetFocus
Exit Sub
End If
password = rs!mima
password1 = MD5(Trim(oldmima.Text))
If password1 <> password Then
MsgBox "您输入的密码不正确!", 48, "信息提示"
oldmima.Text = ""
oldmima.SetFocus
Exit Sub
End If
rs!mima = MD5(Trim(newmima.Text))
rs.Update
MsgBox "密码更新成功!", 48, "信息提示"
oldmima.Text = ""
newmima.Text = ""
queren.Text = ""
End Sub
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
cmbcaozuoyuan.Clear
sql = "select caozuoyuan from admin"
rs.open sql, cn
Do While Not rs.EOF
cmbcaozuoyuan.AddItem rs!caozuoyuan
rs.MoveNext
Loop
rs.Close
End Sub
Private Sub newmima_KeyPress(KeyAscii As Integer)
If newmima.Text <> "" And KeyAscii = 13 Then
queren.SetFocus
Exit Sub
End If
End Sub
Private Sub oldmima_KeyPress(KeyAscii As Integer)
If oldmima.Text <> "" And KeyAscii = 13 Then
newmima.SetFocus
Exit Sub
End If
End Sub
Private Sub queren_KeyPress(KeyAscii As Integer)
If queren.Text <> "" And KeyAscii = 13 Then
cmdok.SetFocus
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -