?? frmmodifypassword.frm
字號:
VERSION 5.00
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form frmModifyPassword
BackColor = &H00D3DABC&
BorderStyle = 1 'Fixed Single
Caption = "修改密碼"
ClientHeight = 3315
ClientLeft = 45
ClientTop = 435
ClientWidth = 4815
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmModifyPassword.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3315
ScaleWidth = 4815
StartUpPosition = 1 '所有者中心
Begin XPControls.XPCommandButton cmdCancel
Cancel = -1 'True
Height = 375
Left = 2670
TabIndex = 10
Top = 2790
Width = 1035
_ExtentX = 1826
_ExtentY = 661
Caption = "取消(&C)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdOK
Height = 375
Left = 1110
TabIndex = 9
Top = 2790
Width = 1035
_ExtentX = 1826
_ExtentY = 661
Caption = "確定(&O)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Frame Frame1
BackColor = &H00D3DABC&
Caption = "密碼信息"
Height = 2445
Left = 240
TabIndex = 3
Top = 180
Width = 4335
Begin VB.TextBox txtOldPassword
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 1860
PasswordChar = "*"
TabIndex = 0
Top = 750
Width = 2265
End
Begin VB.TextBox txtNewPassword1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 1860
PasswordChar = "*"
TabIndex = 1
Top = 1320
Width = 2265
End
Begin VB.TextBox txtNewPassword2
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 1860
PasswordChar = "*"
TabIndex = 2
Top = 1890
Width = 2265
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "當前用戶:"
Height = 240
Left = 930
TabIndex = 8
Top = 300
Width = 900
End
Begin VB.Label lblName
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblName"
Height = 240
Left = 1920
TabIndex = 7
Top = 300
Width = 765
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "請輸入舊密碼:"
Height = 240
Left = 570
TabIndex = 6
Top = 850
Width = 1260
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "請輸入新密碼:"
Height = 240
Left = 570
TabIndex = 5
Top = 1400
Width = 1260
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "請再次輸入新密碼:"
Height = 240
Left = 210
TabIndex = 4
Top = 1950
Width = 1620
End
End
End
Attribute VB_Name = "frmModifyPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Me.Hide
Unload Me
End Sub
Private Sub cmdCancel_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "取消"
End Sub
Private Sub cmdOK_Click()
On Error GoTo ErrMsg
Dim strPassword As String
Dim strSQL As String
Dim Status
Dim rstemp As New ADODB.Recordset
txtOldPassword.Text = CheckString(txtOldPassword.Text)
txtNewPassword1.Text = CheckString(txtNewPassword1.Text)
txtNewPassword2.Text = CheckString(txtNewPassword2.Text)
If txtNewPassword1.Text <> txtNewPassword2.Text Then
MsgBox "兩次輸入密碼不一致,請重新輸入!", vbInformation, "密碼不一致"
txtNewPassword1.SetFocus
Exit Sub
End If
If Len(txtNewPassword1.Text) < 6 Then
MsgBox "為了系統的安全性,密碼長度不能低于六位。請重新輸入!", vbInformation, "密碼太短"
txtNewPassword1.SetFocus
Exit Sub
End If
' strPassword = "/" & Incode(txtOldPassword.Text) & "/"
strPassword = txtOldPassword.Text
strSQL = "select count(*) from RY_Employee where Name='" _
& gstrManagerName & "' and Password='" & strPassword & "'"
rstemp.Open strSQL, GCon, adOpenStatic, adLockReadOnly
If rstemp(0) < 1 Then
MsgBox "您輸入的舊密碼不對,請重新輸入!", vbInformation, "舊密碼錯"
txtOldPassword.SetFocus
Exit Sub
End If
rstemp.Close
Set rstemp = Nothing
' strPassword = "/" & Incode(txtNewPassword1.Text) & "/"
strPassword = txtNewPassword1.Text
strSQL = "update RY_Employee set Password='" & strPassword _
& "' where Name='" & gstrManagerName & "'"
GCon.Execute strSQL
MsgBox "密碼修改成功!", vbInformation, "恭喜"
' '添加到日志
' AddLog gstrManagerName, "成功修改自己的密碼", OperationLog
cmdCancel_Click
Exit Sub
ErrMsg:
Status = SetError(Err.Number, Err.Description, Me.Caption & ".cmdOK_Click")
ErrMsg Status
End Sub
Private Sub cmdOK_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "確定"
End Sub
Private Sub Form_Load()
lblName.Caption = gstrManagerName
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "Ready"
End Sub
Private Sub Form_Unload(Cancel As Integer)
ShowStatus "Ready"
End Sub
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "密碼信息"
End Sub
Private Sub txtNewPassword1_GotFocus()
txtNewPassword1.SelStart = 0
txtNewPassword1.SelLength = Len(txtNewPassword1.Text)
End Sub
Private Sub txtNewPassword1_KeyPress(KeyAscii As Integer)
EnterToTab KeyAscii
End Sub
Private Sub txtNewPassword1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "輸入新密碼"
End Sub
Private Sub txtNewPassword2_GotFocus()
txtNewPassword2.SelStart = 0
txtNewPassword2.SelLength = Len(txtNewPassword2.Text)
End Sub
Private Sub txtNewPassword2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdOK_Click
End If
End Sub
Private Sub txtNewPassword2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "再次輸入新密碼"
End Sub
Private Sub txtOldPassword_GotFocus()
txtOldPassword.SelStart = 0
txtOldPassword.SelLength = Len(txtOldPassword.Text)
End Sub
Private Sub txtOldPassword_KeyPress(KeyAscii As Integer)
EnterToTab KeyAscii
End Sub
Private Sub txtOldPassword_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ShowStatus "輸入舊密碼"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -