📄 frmdenlu.frm
字号:
VERSION 5.00
Begin VB.Form Frmdenlu
Caption = "登录"
ClientHeight = 6690
ClientLeft = 3360
ClientTop = 2880
ClientWidth = 9735
Icon = "Frmdenlu.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6690
ScaleWidth = 9735
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Height = 300
Left = 6720
Picture = "Frmdenlu.frx":1CFA
Style = 1 'Graphical
TabIndex = 6
Top = 5760
Width = 1095
End
Begin VB.CommandButton Command1
Height = 300
Left = 2040
Picture = "Frmdenlu.frx":2255
Style = 1 'Graphical
TabIndex = 5
Top = 5760
Width = 1095
End
Begin VB.Frame Frame1
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
ForeColor = &H80000008&
Height = 2415
Left = 2280
TabIndex = 0
Top = 1800
Width = 4935
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 350
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 4
Top = 1440
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 350
Left = 2160
TabIndex = 2
Top = 600
Width = 2055
End
Begin VB.Label Label2
Caption = "密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 3
Top = 1440
Width = 975
End
Begin VB.Label Label1
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 1
Top = 600
Width = 975
End
End
Begin VB.Label Label3
Caption = "学校管理系统"
BeginProperty Font
Name = "黑体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000080FF&
Height = 855
Left = 3360
TabIndex = 7
Top = 600
Width = 3015
End
End
Attribute VB_Name = "Frmdenlu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '登录确定
Dim mrc As ADODB.Recordset
txtsql = "select username from use where username='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Exit Sub
End If
username = mrc.Fields(0)
txtsql = "select username from use where password='" & Trim(Text2.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 密码错误!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
Exit Sub
End If
MDIForm1.Show
Unload Me
End Sub
Private Sub Command2_Click() '取消
Unload Me
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 'table键
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -