?? frmpsw.frm
字號:
VERSION 5.00
Object = "{AD03F86E-2FCA-4C6B-BAFD-3B3A9708EC72}#2.0#0"; "UserCtrProj.ocx"
Begin VB.Form frmPsw
BorderStyle = 1 'Fixed Single
Caption = "用戶登錄"
ClientHeight = 2505
ClientLeft = 45
ClientTop = 330
ClientWidth = 4110
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2505
ScaleWidth = 4110
StartUpPosition = 3 'Windows Default
Begin UserCtrProj.UsrPicBtn cmdCancel
Height = 525
Left = 2280
TabIndex = 3
Top = 1680
Width = 1335
_ExtentX = 2355
_ExtentY = 926
Picture = "frmPsw.frx":0000
Caption = " 取消"
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
End
Begin UserCtrProj.UsrPicBtn cmdOk
Height = 525
Left = 480
TabIndex = 2
Top = 1680
Width = 1335
_ExtentX = 2355
_ExtentY = 926
Picture = "frmPsw.frx":0100
Caption = " 確定"
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
End
Begin UserCtrProj.UsrCtrText txtPsw
Height = 375
Left = 1680
TabIndex = 1
Top = 960
Width = 1935
_ExtentX = 3413
_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 txtUser
Height = 375
Left = 1680
TabIndex = 0
Top = 240
Width = 1935
_ExtentX = 3413
_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
FontSize = 8.25
FontName = "MS Sans Serif"
End
Begin VB.Label lblPsw
Caption = "請輸入密碼:"
Height = 375
Left = 120
TabIndex = 5
Top = 960
Width = 1335
End
Begin VB.Label lblName
Caption = "請輸入用戶名:"
Height = 375
Left = 120
TabIndex = 4
Top = 240
Width = 1335
End
End
Attribute VB_Name = "frmPsw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
'取消所有載入的窗體
Unload frmMainMDI
Unload frmFlash
Unload Me
End Sub
Private Sub cmdOk_Click()
Dim rsLoad As ADODB.Recordset
Dim strSql As String
dbUser = txtUser.Text
usrPsw = txtPsw.Text
'用來從數據庫中獲取記錄集的字符串,SQL語句
strSql = "select * from uUsers where 用戶名=" & "'" & dbUser & "'" & _
" and 用戶密碼=" & "'" & usrPsw & "'"
'顯示快閃窗體
Load frmFlash
frmFlash.Show
DoEvents
'利用StarModule里定義的獲取記錄集的函數獲取數據庫中用戶表的記錄集
Set rsLoad = GetRecordSet(strSql)
'判斷表是否不包含任何記錄
If Not (rsLoad.EOF And rsLoad.BOF) Then
'執行這兩條記錄是為了數據庫能正確的返回記錄個數
rsLoad.MoveLast
rsLoad.MoveFirst
'其實,如果包含記錄的話,就已經等于有該用戶存在了
'此處的語句屬于多余
If rsLoad.RecordCount > 0 Then
'取得用戶權限,以備后面之用
strUsrLevel = Trim$(rsLoad("用戶權限"))
'載入應用程序主窗體,激活系統登錄的隱含檢測步驟
Load frmMainMDI
frmMainMDI.Show
Unload frmFlash '關閉快閃窗體
Else
MsgBox "用戶名或密碼錯誤!"
Exit Sub
End If
Else
MsgBox "用戶名或密碼錯誤!"
Unload frmFlash '關閉快閃窗體
txtUser.SetFocus
txtUser.SelLength = Len(txtUser.Text)
Exit Sub
End If
rsLoad.Close
Set rsLoad = Nothing
Unload frmPsw
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 + -