?? frmlogin.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmLogin
Caption = "登錄"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 6
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "確定"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 5
Top = 2160
Width = 1215
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 4
Top = 1560
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
Left = 2040
TabIndex = 3
Top = 960
Width = 1695
End
Begin VB.Label Label3
Caption = "用戶密碼"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 2
Top = 1560
Width = 1335
End
Begin VB.Label Label2
Caption = "用戶名"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 1
Top = 1080
Width = 855
End
Begin VB.Label Label1
Caption = "企事業(yè)單位人員管理系統(tǒng)"
BeginProperty Font
Name = "宋體"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 360
Width = 3975
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public OK As Boolean
Dim miCount As Integer
Dim UserName As String
Private Sub Command1_Click()
'用來(lái)存放SQL語(yǔ)句
Dim txtSQL As String
'用來(lái)存放記錄集對(duì)象
Dim mrc As New ADODB.Recordset
'用來(lái)存放返回信息
Dim MsgText As String
UserName = ""
'判斷輸入用戶名是否為空
If Trim(Text1.Text = "") Then
MsgBox "沒(méi)有這個(gè)用戶,請(qǐng)重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Else
'查詢指定用戶名記錄
txtSQL = "select * from user_Info where user_ID='" & Text1.Text & "'"
'執(zhí)行查詢語(yǔ)句
Set mrc = ExecuteSQL(txtSQL, MsgText)
'mrc.Open
If mrc.EOF = True Then
MsgBox "沒(méi)有這個(gè)用戶,請(qǐng)重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Else
'判斷輸入密碼是否正確
If Trim(mrc.Fields(1)) = Trim(Text2.Text) Then
Me.Hide
OK = True
mrc.Close
UserName = Trim(Text1.Text)
frmMain.Show
Else
MsgBox "輸入密碼不正確,請(qǐng)重新輸入!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Text2.Text = ""
End If
End If
End If
'記載輸入密碼次數(shù)
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub Command2_Click()
OK = False
Me.Hide
End Sub
Private Sub Form_Load()
OK = False
miCount = 0
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -