- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form LoginSys
- Caption = "晗青图书管理系统_管理员登录"
- ClientHeight = 5610
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6375
- Icon = "LoginSys.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 5610
- ScaleWidth = 6375
- StartUpPosition = 2 '屏幕中心
- Begin MSComctlLib.StatusBar StatusBar1
- Align = 2 'Align Bottom
- Height = 375
- Left = 0
- TabIndex = 6
- Top = 5235
- Width = 6375
- _ExtentX = 11245
- _ExtentY = 661
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 4
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Alignment = 1
- Text = "晗青软件工作室"
- TextSave = "晗青软件工作室"
- EndProperty
- BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Alignment = 1
- Object.Width = 3528
- MinWidth = 3528
- Text = "recker.myrice.com"
- TextSave = "recker.myrice.com"
- EndProperty
- BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Alignment = 1
- Object.Width = 3528
- MinWidth = 3528
- Text = "jinghui2000@263.net"
- TextSave = "jinghui2000@263.net"
- EndProperty
- BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 5
- Alignment = 1
- TextSave = "12:42"
- EndProperty
- EndProperty
- End
- Begin VB.CommandButton cmdOkCancel
- BackColor = &H000080FF&
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 375
- Index = 1
- Left = 5160
- Style = 1 'Graphical
- TabIndex = 5
- Top = 1200
- Width = 855
- End
- Begin VB.CommandButton cmdOkCancel
- BackColor = &H000080FF&
- Caption = "确定(&E)"
- Default = -1 'True
- Height = 375
- Index = 0
- Left = 4200
- Style = 1 'Graphical
- TabIndex = 4
- Top = 1200
- Width = 855
- End
- Begin VB.TextBox txtPass
- Height = 270
- IMEMode = 3 'DISABLE
- Left = 4560
- PasswordChar = "*"
- TabIndex = 3
- Text = "Text1"
- Top = 720
- Width = 1575
- End
- Begin VB.ComboBox comPer
- Height = 300
- Left = 4560
- TabIndex = 2
- Text = "Combo1"
- Top = 240
- Width = 1575
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackColor = &H8000000A&
- Caption = "密码"
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H0000FF00&
- Height = 210
- Index = 1
- Left = 3960
- TabIndex = 1
- Top = 720
- Width = 465
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackColor = &H8000000A&
- Caption = "管理员"
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H0000FF00&
- Height = 210
- Index = 0
- Left = 3720
- TabIndex = 0
- Top = 240
- Width = 690
- End
- Begin VB.Image Image1
- Height = 6405
- Left = 0
- Picture = "LoginSys.frx":0442
- Top = 0
- Width = 9600
- End
- End
- Attribute VB_Name = "LoginSys"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim Asc() As Integer
- Dim db As Database
- Dim rst As Recordset
- Dim Rec As Integer
- Private Sub cmdOkCancel_Click(Index As Integer)
- Dim i As Integer
- i = 0
- Select Case Index
- Case 0
- If txtPass.Text = "" Or comPer.Text = "" Then
- MsgBox "请选择用户名或输入密码!", 0 + 48, "提示"
- txtPass.SetFocus
- Exit Sub
- End If
- If Val(txtPass.Text) = Asc(comPer.ListIndex) Then
- 'MsgBox "正确"
- Mainfrm.Show
- Unload Me
- Else
- MsgBox "密码错误,请重试!", 0 + 16, "错误"
- txtPass.SetFocus
- Exit Sub
- End If
- Case 1
- Unload Me
- End Select
- End Sub
- Private Sub Form_Load()
- Set db = Workspaces(0).OpenDatabase("DatabaseData.mdb", False)
- Set rst = db.OpenRecordset("Pass", dbOpenTable)
- rst.MoveLast
- Rec = rst.RecordCount
- ReDim Asc(Rec - 1)
- rst.MoveFirst
- For i = 1 To Rec
- comPer.AddItem rst.Fields("名称")
- Asc(i - 1) = Val(rst.Fields("密码"))
- rst.MoveNext
- If rst.EOF Then Exit For
- Next
- comPer.Text = ""
- txtPass.Text = ""
- End Sub