📄 formlanding.frm
字号:
VERSION 5.00
Begin VB.Form FormLanding
BorderStyle = 3 'Fixed Dialog
Caption = "学生信息管理系统"
ClientHeight = 3090
ClientLeft = 45
ClientTop = 435
ClientWidth = 4830
Icon = "FormLanding.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "FormLanding.frx":0442
ScaleHeight = 3090
ScaleWidth = 4830
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox txtUserName
Height = 300
Left = 1080
TabIndex = 1
Top = 1560
Width = 2415
End
Begin VB.CommandButton Command2
Appearance = 0 'Flat
Caption = "用户登陆"
Height = 375
Left = 2640
Picture = "FormLanding.frx":112E
Style = 1 'Graphical
TabIndex = 4
Top = 2520
Width = 1335
End
Begin VB.CommandButton cmdOK
Appearance = 0 'Flat
Caption = "管理员登陆"
Height = 375
Left = 600
Picture = "FormLanding.frx":1E1A
Style = 1 'Graphical
TabIndex = 3
Top = 2520
Width = 1335
End
Begin VB.TextBox txtPassword
DataField = "密码"
DataSource = "Data1"
Height = 300
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 2
Top = 2040
Width = 2415
End
Begin VB.PictureBox Picture2
BorderStyle = 0 'None
Height = 1455
Left = 3240
Picture = "FormLanding.frx":2B06
ScaleHeight = 1455
ScaleWidth = 1455
TabIndex = 5
Top = 0
Width = 1455
End
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 975
Left = 0
Picture = "FormLanding.frx":3DB5
ScaleHeight = 975
ScaleWidth = 2295
TabIndex = 0
Top = 0
Width = 2295
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 = 255
Left = 240
TabIndex = 8
Top = 2040
Width = 975
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
Height = 255
Left = 240
TabIndex = 7
Top = 1560
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "秦皇岛分校"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 375
Left = 1560
TabIndex = 6
Top = 1080
Width = 1695
End
End
Attribute VB_Name = "FormLanding"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Dim txtSQL As String
Dim Mrc As ADODB.Recordset
Dim Msgtext As String
Dim miCount As Integer
Private Sub Command2_Click()
MDIFormMain.banchu.Enabled = False
MDIFormMain.bangai.Enabled = False
MDIFormMain.bantian.Enabled = False
MDIFormMain.chenggai.Enabled = False
MDIFormMain.chenglu.Enabled = False
MDIFormMain.chengshan.Enabled = False
MDIFormMain.chengxun.Enabled = True
MDIFormMain.dangchu.Enabled = False
MDIFormMain.danggai.Enabled = False
MDIFormMain.dangru.Enabled = False
MDIFormMain.dangxun.Enabled = True
MDIFormMain.tianjiazaxian.Enabled = False
MDIFormMain.jiangji.Enabled = False
MDIFormMain.tianyuan.Enabled = False
MDIFormMain.tuixue.Enabled = False
MDIFormMain.xiumi.Enabled = False
MDIFormMain.xuejichaxun.Enabled = True
MDIFormMain.zaxun.Enabled = True
MDIFormMain.zhuanxue.Enabled = False
MDIFormMain.Visible = True
MDIFormMain.banzhuzhuti.Enabled = False
MDIFormMain.xuejishanchu.Enabled = False
MDIFormMain.xuejixiugai.Enabled = False
MDIFormMain.zachu.Enabled = False
MDIFormMain.zagai.Enabled = False
Unload FormLanding
End Sub
Private Sub Form_Load()
Dim i As Integer
i = 0
txtSQL = "select * from 管理"
Set Mrc = ExecuteSQL(txtSQL, Msgtext)
With txtUserName
Do While Not Mrc.EOF
i = i + 1
.AddItem Trim(Mrc!管理员)
Mrc.MoveNext
Loop
.ListIndex = i - 1
End With
Mrc.Close
OK = False
miCount = 0
End Sub
Private Sub cmdOK_Click()
txtSQL = "select * from 管理 where 管理员 = '" & 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
OK = True
Mrc.Close
Me.Hide
MDIFormMain.Visible = True
MDIFormMain.Enabled = True
UserName = Trim(txtUserName.Text)
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
EnterToTab KeyCode
End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdOK_Click
End If
End Sub
Private Sub txtUserName_Click()
txtPassword.Text = ""
End Sub
Private Sub txtUserName_KeyDown(KeyCode As Integer, Shift As Integer)
EnterToTab KeyCode
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -