📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin
BorderStyle = 0 'None
Caption = "登录"
ClientHeight = 4995
ClientLeft = 3000
ClientTop = 3000
ClientWidth = 7500
Icon = "Form1.frx":0000
LinkTopic = "from1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "Form1.frx":08CA
ScaleHeight = 4995
ScaleMode = 0 'User
ScaleWidth = 7490.637
ShowInTaskbar = 0 'False
Begin VB.Timer Timer1
Interval = 10
Left = 6960
Top = 4560
End
Begin MSAdodcLib.Adodc adoUser
Height = 615
Left = 1680
Top = 4680
Visible = 0 'False
Width = 4455
_ExtentX = 7858
_ExtentY = 1085
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=student_data\student_massage.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=student_data\student_massage.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4320
TabIndex = 6
Top = 3960
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "登录"
Default = -1 'True
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 5
Top = 3960
Width = 1335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2760
PasswordChar = "*"
TabIndex = 4
Text = "admin"
Top = 2880
Width = 2775
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 2
Text = "admin"
Top = 2160
Width = 2775
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "楷体_GB2312"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF80&
Height = 360
Left = 1560
TabIndex = 3
Top = 2880
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名"
BeginProperty Font
Name = "楷体_GB2312"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF80&
Height = 360
Left = 1560
TabIndex = 1
Top = 2160
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学生信息管理系统"
BeginProperty Font
Name = "华文彩云"
Size = 36
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF80&
Height = 750
Left = 840
TabIndex = 0
Top = 480
Width = 5760
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim sngstart As Single
Private Sub Command2_Click()
End
End Sub
Private Sub Command1_Click()
Static interr As Integer
Dim strUser As String, strPass As String, strSQL As String
strUser = Trim$(Text1.Text)
strPass = Trim$(Text2.Text)
strSQL = "select * from 用户 where 用户名='" & strUser & "'AND 密码='" & strPass & "'"
With adoUser
.CommandType = adCmdText
.RecordSource = strSQL
.Refresh
If .Recordset.EOF And .Recordset.BOF Then
interr = interr + 1
If interr >= 3 Then
MsgBox "对不起,无权使用本系统。", vbExclamation, "提示"
End
Else
MsgBox "用户名或密码错误,请重新输入!", vbExclamation, "提示"
Call FocusBack(Text1)
End If
Else
gstruser = strUser
If .Recordset("权限") = "管理员" Then
gblnPurview = True
Else
gblnPurview = False
End If
login.Show
Unload Me
End If
End With
End Sub
Private Sub Form_Initialize()
ChDrive App.Path
ChDir App.Path
End Sub
Private Sub Form_Load()
Me.Height = 100
Me.Width = 100
End Sub
Private Sub Timer1_Timer()
Me.Height = Me.Height + 100
Me.Width = Me.Width + 150
If Me.Width > 7350 Then
Timer1.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -