📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form form3
BorderStyle = 0 'None
Caption = "系统登录"
ClientHeight = 4500
ClientLeft = 0
ClientTop = 0
ClientWidth = 6000
Icon = "Form3.frx":0000
LinkTopic = "Form3"
ScaleHeight = 4500
ScaleWidth = 6000
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Left = 5160
Top = 3360
End
Begin VB.CommandButton Command1
Caption = "Command1"
Default = -1 'True
Height = 495
Left = 4800
TabIndex = 3
Top = -3000
Width = 1215
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 2
Top = 2450
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2160
TabIndex = 0
Top = 1360
Width = 2055
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "汉仪雪君体繁"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 495
Left = 2040
TabIndex = 1
Top = 1905
Width = 2055
End
Begin VB.Image Image2
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 375
Left = 3120
MouseIcon = "Form3.frx":29C12
MousePointer = 99 'Custom
Top = 3360
Width = 1335
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 375
Left = 1300
MouseIcon = "Form3.frx":29D64
MousePointer = 99 'Custom
Top = 3360
Width = 1335
End
End
Attribute VB_Name = "form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Call Image1_Click
End Sub
Private Sub Form_Load()
Me.Picture = LoadPicture(App.path & "\images\dl.jpg")
If rst.State = adStateOpen Then '在没有任何记录时启用
rst.Close
End If
rst.Open "select * from 个人信息", cnn, adOpenKeyset, adLockReadOnly, adCmdText
If rst.RecordCount = 0 Then
Set rst = cnn.Execute("insert into 个人信息 values('0105222','admin','admin','男','1985-02-20','计算机业','管理员用户','" & Date + 1460 & "','是','0','是')")
End If
End Sub
Private Sub Image1_Click()
Text1.Enabled = False
Text2.Enabled = False
If Text1.Text = "" Then
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
Exit Sub
End If
Set rst = cnn.Execute("select * from 个人信息 where 学号='" & Text1.Text & "' and 密码='" & Text2.Text & "'")
If rst.EOF = True Then
MsgBox "输入学号或密码有误,请检查后输入!", vbInformation, "错误"
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
Exit Sub
End If
Label1.Caption = rst.Fields(1)
idname = Label1.Caption
id = Text1.Text
id1 = Text1.Text
bookindex = rst.Fields(9)
If rst1.State = adStateOpen Then '借书批准
rst1.Close
End If
rst1.Open "select * from 系统", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If rst1.EOF = True Then
Set rst1 = cnn.Execute("insert into 系统 values('10','15','0105222')")
Set rst1 = cnn.Execute("select * from 系统")
Else
If rst.Fields(8) = "是" Then
systembooks = rst1.Fields(1)
Else
systembooks = rst1.Fields(0)
End If
If rst1.Fields(2) <> nonull Then
adminid = rst1.Fields(2)
End If
End If
If rst.Fields(10) = "是" Then
admin = True
Set rst1 = cnn.Execute("update 系统 set 在线管理员='" & rst.Fields(0) & " '")
Else
admin = False
End If
Timer1.Interval = 2000
End Sub
Private Sub Image2_Click()
End
End Sub
Private Sub Timer1_Timer()
Unload Me
form1.Show
Timer1.Interval = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -