?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "系統登錄"
ClientHeight = 3405
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 6030
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2011.787
ScaleMode = 0 'User
ScaleWidth = 5661.844
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
Height = 300
IMEMode = 1 'ON
Left = 1440
Style = 2 'Dropdown List
TabIndex = 3
Top = 2880
Width = 855
End
Begin VB.CommandButton cmdOK
Caption = "確認"
Default = -1 'True
Height = 390
Left = 4080
TabIndex = 1
Top = 2880
Width = 840
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 390
Left = 5040
TabIndex = 2
Top = 2880
Width = 840
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
Height = 345
IMEMode = 3 'DISABLE
Left = 3120
PasswordChar = "*"
TabIndex = 0
Top = 2880
Width = 765
End
Begin VB.Frame Frame1
Height = 735
Left = 120
TabIndex = 4
Top = 2640
Width = 5895
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 6
Text = "選擇用戶:"
Top = 240
Width = 1095
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2280
TabIndex = 5
Text = "密碼:"
Top = 240
Width = 615
End
End
Begin VB.Image Image1
Height = 2655
Left = 0
Picture = "frmLogin.frx":0000
Stretch = -1 'True
Top = 0
Width = 6015
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const MxUser = 100
Public EmploID As Integer
Public CurUser As String
Public CurId As String
Public CurPsw As String
Dim user(MxUser), pws(MxUser), state(MxUser), Emplo(MxUser) As String
Private Sub Form_Load()
Dim i As Integer
If App.PrevInstance Then
MsgBox ("程序已經運行,不能再次裝載。"), vbExclamation
Unload Me
End If
'本段代碼用于判定本程序是否已經裝載于內存中,以避免程序的多重啟動
i = 0
Open App.Path + "\user.ini" For Input As #1
Do While Not EOF(1)
Input #1, user(i), pws(i), state(i), Emplo(i)
If state(i) = "A" Then
Combo1.AddItem user(i)
End If
i = i + 1
Loop
Close #1
Combo1.ListIndex = 1 '在窗口裝載階段讀取用戶設置文件獲取用戶信息 并裝載于用戶列表框中
End Sub
Private Sub CmdCancel_Click()
Unload Me
End
End Sub
Private Sub cmdOK_Click()
If txtPassword = pws(Combo1.ListIndex) Then
CurId = Combo1.ListIndex
EmploID = Emplo(CurId)
CurUser = user(CurId)
CurPsw = pws(CurId)
Me.Hide
'Load FrmMain
FrmMain.Show
Else
MsgBox "密碼錯誤,請重新輸入!", , "系統登錄"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -