📄 frmlogin.frm
字号:
VERSION 5.00
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Begin VB.Form frmLogin
Caption = "登录界面"
ClientHeight = 7665
ClientLeft = 3045
ClientTop = 2025
ClientWidth = 9870
LinkTopic = "Form1"
ScaleHeight = 7665
ScaleWidth = 9870
Begin VB.Frame Frame1
Caption = "管理员通知"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2175
Left = 3840
TabIndex = 10
Top = 4440
Width = 5175
Begin VB.TextBox txtmessage
Height = 1335
Left = 240
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 11
Top = 480
Width = 4695
End
End
Begin MSACAL.Calendar Calendar1
Height = 2295
Left = 3720
TabIndex = 8
Top = 1800
Width = 5415
_Version = 524288
_ExtentX = 9551
_ExtentY = 4048
_StockProps = 1
BackColor = -2147483633
Year = 2007
Month = 7
Day = 1
DayLength = 3
MonthLength = 1
DayFontColor = 0
FirstDay = 7
GridCellEffect = 1
GridFontColor = 10485760
GridLinesColor = -2147483632
ShowDateSelectors= -1 'True
ShowDays = -1 'True
ShowHorizontalGrid= -1 'True
ShowTitle = -1 'True
ShowVerticalGrid= -1 'True
TitleFontColor = 10485760
ValueIsNull = 0 'False
BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.CommandButton cmdCancel
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 7
Top = 3720
Width = 735
End
Begin VB.CommandButton cmdOK
Caption = "登录"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 6
Top = 3720
Width = 735
End
Begin VB.TextBox txtpassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 5
Top = 3000
Width = 1575
End
Begin VB.TextBox txtusername
Height = 375
Left = 1680
TabIndex = 4
Top = 2280
Width = 1575
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "LML工作室设计 版权所有(C)"
Height = 255
Left = 7320
TabIndex = 12
Top = 7320
Width = 2415
End
Begin VB.Image Image1
Height = 2340
Left = 360
Picture = "frmLogin.frx":0000
Top = 4440
Width = 3135
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = 0
X2 = 9840
Y1 = 1570
Y2 = 1570
End
Begin VB.Line Line1
BorderWidth = 2
X1 = 0
X2 = 9840
Y1 = 1560
Y2 = 1560
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "Label5"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 495
Left = 3960
TabIndex = 9
Top = 6840
Width = 3855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 720
TabIndex = 3
Top = 3000
Width = 735
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 720
TabIndex = 2
Top = 2400
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "四院八队"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 7080
TabIndex = 1
Top = 1200
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "学生信息管理系统"
BeginProperty Font
Name = "宋体"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 495
Left = 2760
TabIndex = 0
Top = 480
Width = 4455
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'查询语句
Dim txtSQL As String
Dim MsgText As String
Dim mrc As ADODB.Recordset
'判断用户名是否为空
If (Trim(txtusername.Text) = "") Then
MsgBox "用户名不能为空,请输入用户名!", vbOKOnly + vbExclamation, "警告!"
txtusername.SetFocus
Else
'构造查询语句
txtSQL = "select * from mima where username=" & "'" & Trim(txtusername.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
'判断是否有这用户
If mrc.EOF = True Then
MsgBox "没有这个用户,请重新输入!", vbOKOnly + vbExclamation, "警告!"
txtusername.SetFocus
Else
'判断输入密码是否正确
If Trim(mrc.Fields(1)) = Trim(txtpassword.Text) Then
UserName = mrc.Fields(0) '纪录用户名
UserType = mrc.Fields(2) '纪录用户类型
main_frm.Show
Editpassword.Text1.Text = txtusername.Text
Else
MsgBox "密码错误,请重新输入!", vbOKOnly + vbExclamation, "警告!"
txtpassword.SetFocus
txtpassword.Text = ""
Exit Sub
End If
mrc.Close
End If
End If
End Sub
Private Sub Form_Load()
Label5.Caption = Time()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -