?? frmmodifypsw.frm
字號:
VERSION 5.00
Object = "{C2A990D9-DFD1-4B7C-A432-A1DD219DC55F}#1.0#0"; "UserCtrProj.ocx"
Begin VB.Form frmModifyPsw
Caption = "修改密碼"
ClientHeight = 2790
ClientLeft = 60
ClientTop = 345
ClientWidth = 4170
LinkTopic = "Form2"
ScaleHeight = 2790
ScaleWidth = 4170
StartUpPosition = 3 'Windows Default
Begin UserCtrProj.UsrCtrText txtConfirmPsw
Height = 375
Left = 1800
TabIndex = 3
Top = 1440
Width = 1695
_ExtentX = 2990
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
PasswordChar = "*"
FontSize = 8.25
FontName = "MS Sans Serif"
End
Begin UserCtrProj.UsrCtrText txtNewPsw
Height = 375
Left = 1800
TabIndex = 2
Top = 840
Width = 1695
_ExtentX = 2990
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
PasswordChar = "*"
FontSize = 8.25
FontName = "MS Sans Serif"
End
Begin UserCtrProj.UsrCtrText txtOldPsw
Height = 375
Left = 1800
TabIndex = 1
Top = 240
Width = 1695
_ExtentX = 2990
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
PasswordChar = "*"
FontSize = 8.25
FontName = "MS Sans Serif"
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 2640
TabIndex = 5
Top = 2280
Width = 1095
End
Begin VB.CommandButton cmdOk
Caption = "確定"
Height = 375
Left = 600
Picture = "frmModifyPsw.frx":0000
TabIndex = 4
Top = 2280
Width = 1215
End
Begin VB.Label lblConfirmPsw
Caption = "確定新密碼:"
Height = 255
Left = 240
TabIndex = 7
Top = 1440
Width = 1215
End
Begin VB.Label lblNewPsw
Caption = "輸入新密碼:"
Height = 255
Left = 240
TabIndex = 6
Top = 840
Width = 1215
End
Begin VB.Label lblOldPsw
Caption = "輸入舊密碼:"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "frmModifyPsw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rsPsw As ADODB.Recordset
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
'定義用來鏈接數據庫獲取記錄集的SQL語句
Dim strSql As String
Set rsPsw = New Recordset
'用到了全局變量dbUser和usrPsw,記錄當前登錄的用戶名,這樣
'返回的記錄集將只有一條記錄
strSql = "select * from uUsers where 用戶名=" & "'" & dbUser & "'" & _
" and 用戶密碼=" & "'" & usrPsw & "'"
'用當前登錄的用戶名和密碼作為查詢條件來生成記錄集
Set rsPsw = GetRecordSet(strSql)
'如果返回的rsPsw記錄集為空,則屬于發生了比較嚴重的錯誤,需要重新登錄
If rsPsw.EOF And rsPsw.BOF Then
MsgBox "當前系統用戶錯誤,請重新登錄!"
Exit Sub
End If
'如果當前輸入舊密碼正確,那么就開始執行密碼修改的工作,否則將提示出錯
If usrPsw = Trim$(txtOldPsw.Text) Then
rsPsw.MoveLast
rsPsw.MoveFirst
'對兩次輸入的密碼進行比較,如果一致,那么密碼修改成功
If Trim$(txtNewPsw.Text) = Trim$(txtConfirmPsw.Text) Then
rsPsw("用戶密碼") = Trim$(txtNewPsw.Text)
rsPsw.Update
Unload frmModifyPsw
Else
MsgBox "前后輸入的新密碼不一致!"
txtNewPsw.SetFocus
txtConfirmPsw.Text = vbNullString
Exit Sub
End If
Else
MsgBox "原始密碼輸入錯誤!"
txtOldPsw.SetFocus
Exit Sub
End If
End Sub
Private Sub Form_Load()
Move (Screen.Width - Me.Width) / 2, _
(Screen.Height - Me.Height) / 2
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -