📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "利军学生成绩管理系统V1.0"
ClientHeight = 2040
ClientLeft = 5325
ClientTop = 4455
ClientWidth = 3750
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1205.299
ScaleMode = 0 'User
ScaleWidth = 3521.047
ShowInTaskbar = 0 'False
Begin VB.OptionButton Option2
Caption = "老师"
Height = 255
Left = 2280
TabIndex = 7
Top = 1080
Width = 735
End
Begin VB.OptionButton Option1
Caption = "学生"
Height = 255
Left = 960
TabIndex = 6
Top = 1080
Value = -1 'True
Width = 735
End
Begin VB.TextBox txtUserName
Height = 345
Left = 1290
TabIndex = 1
Top = 120
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 390
Left = 480
TabIndex = 4
Top = 1500
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 390
Left = 2100
TabIndex = 5
Top = 1500
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 1290
PasswordChar = "*"
TabIndex = 3
Top = 525
Width = 2325
End
Begin VB.Label iz
Caption = "Label1"
Height = 375
Left = 120
TabIndex = 8
Top = 960
Visible = 0 'False
Width = 615
End
Begin VB.Label lblLabels
Caption = "用户名称(&U):"
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 150
Width = 1080
End
Begin VB.Label lblLabels
Caption = "密码(&P):"
Height = 270
Index = 1
Left = 105
TabIndex = 2
Top = 540
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim student As studtype
Dim reno As Integer
Public Sub dak()
Dim mpath As String
mpath = App.Path
If Right(mpath, 1) <> "\" Then mpath = mpath + "\"
mpath = mpath + "chengji.txt"
Open mpath For Random As #1 Len = Len(student)
reno = LOF(1) / Len(student)
End Sub
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
If Option1.Value = True Then
Call dak
For i = 1 To reno
Get #1, i, student
If Trim(student.snum) = txtUserName And Trim(student.pass) = txtPassword Then
flag = 1
iz.Caption = i
Exit For
Else
flag = 0
End If
Next
Close #1
If flag = 1 Then
Me.Hide
Form2.Show
Else
MsgBox "输入有误,请重试!", , "登录"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Else
If txtUserName = "admin" And txtPassword = "admin" Then
Me.Hide
Form1.Show
Else
MsgBox "输入有误,请重试!", , "登录"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -