?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登錄系統(tǒng)"
ClientHeight = 2655
ClientLeft = 30
ClientTop = 330
ClientWidth = 4470
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmLogin.frx":0442
ScaleHeight = 2655
ScaleWidth = 4470
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "Login"
Begin VB.Timer Timer2
Interval = 500
Left = 3600
Top = 120
End
Begin VB.Timer Timer1
Interval = 500
Left = 2400
Top = 120
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "退 出"
Height = 345
Left = 3360
TabIndex = 5
Tag = "Cancel"
Top = 2280
Width = 780
End
Begin VB.CommandButton cmdOK
Caption = "登 錄"
Default = -1 'True
Height = 345
Left = 2040
TabIndex = 4
Tag = "OK"
Top = 2280
Width = 900
End
Begin VB.TextBox txtPassword
Height = 288
IMEMode = 3 'DISABLE
Left = 1305
PasswordChar = "*"
TabIndex = 1
Top = 1452
Width = 1710
End
Begin VB.TextBox txtUserName
Height = 288
Left = 1305
TabIndex = 0
Top = 1056
Width = 870
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H80000000&
BackStyle = 0 'Transparent
Caption = "企業(yè)人事管理信息系統(tǒng)"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 180
Left = 0
TabIndex = 6
Top = 240
Width = 1950
End
Begin VB.Label lblLabels
BackStyle = 0 'Transparent
Caption = "密 碼:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 252
Index = 1
Left = 348
TabIndex = 2
Tag = "&Password:"
Top = 1464
Width = 1080
End
Begin VB.Label lblLabels
BackStyle = 0 'Transparent
Caption = "用戶名:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 252
Index = 0
Left = 348
TabIndex = 3
Tag = "&User Name:"
Top = 1080
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Dim micount As Integer
Private Sub Form_Load()
OK = False
micount = 0
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
'ToDo: create test for correct password
'check for correct password
UserName = ""
If Trim(txtUserName.Text = "") Then
MsgBox "沒有這個用戶,請重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
txtSQL = "select * from user_Info where user_ID = '" & txtUserName.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
MsgBox "沒有這個用戶,請重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then
OK = True
mrc.Close
Me.Hide
UserName = Trim(txtUserName.Text)
Else
MsgBox "輸入密碼不正確,請重新輸入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
End If
micount = micount + 1
If micount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub Timer1_Timer()
Label1.FontSize = Label1.FontSize + 3
If Label1.Width >= Me.Width Then Label1.FontSize = 15
End Sub
Private Sub Timer2_Timer()
Dim x, y, z
x = 255 * Rnd(255)
y = 255 * Rnd(255)
z = 255 * Rnd(255)
Label1.ForeColor = RGB(x, y, z)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -