📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "用户登录"
ClientHeight = 4185
ClientLeft = 3210
ClientTop = 2490
ClientWidth = 6330
LinkTopic = "Form1"
ScaleHeight = 4185
ScaleWidth = 6330
Begin VB.Frame Frame1
Height = 3855
Left = 120
TabIndex = 0
Top = 120
Width = 6015
Begin MSAdodcLib.Adodc Adodc2
Height = 495
Left = 4440
Top = 3240
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=学生管理"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=学生管理"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "管理员帐户"
Caption = "Adodc2"
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.TextBox Text4
DataField = "密码"
DataSource = "Adodc2"
Height = 495
Left = 480
TabIndex = 13
Text = "Text4"
Top = 2760
Visible = 0 'False
Width = 855
End
Begin VB.TextBox Text3
DataField = "帐号"
DataSource = "Adodc2"
Height = 495
Left = 480
TabIndex = 12
Text = "Text3"
Top = 1920
Visible = 0 'False
Width = 855
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 4560
Top = 840
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=学生管理"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=学生管理"
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.TextBox Text2
DataField = "密码"
DataSource = "Adodc1"
Height = 495
Left = 4680
TabIndex = 11
Top = 2280
Visible = 0 'False
Width = 855
End
Begin VB.TextBox Text1
DataField = "帐号"
DataSource = "Adodc1"
Height = 495
Left = 4680
TabIndex = 10
Top = 1560
Visible = 0 'False
Width = 855
End
Begin VB.ComboBox UserName
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "Form1.frx":0000
Left = 1560
List = "Form1.frx":0002
TabIndex = 1
Top = 720
Width = 2655
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 495
Left = 2880
TabIndex = 6
Top = 2760
Width = 975
End
Begin VB.CommandButton CmdOK
Caption = "登录"
Height = 495
Left = 1560
TabIndex = 5
Top = 2760
Width = 975
End
Begin VB.Frame Frame2
Height = 615
Left = 1560
TabIndex = 3
Top = 1920
Width = 2535
Begin VB.OptionButton student
Caption = "学生"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1440
TabIndex = 4
Top = 240
Value = -1 'True
Width = 855
End
Begin VB.OptionButton teacher
Caption = "教师"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 360
TabIndex = 9
Top = 240
Width = 855
End
End
Begin VB.TextBox Password
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 2
Top = 1320
Width = 2655
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 8
Top = 1440
Width = 480
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "帐号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 7
Top = 720
Width = 480
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub teacher_Click()
If teacher.Value = True Then
i = 1
End If
End Sub
Private Sub student_Click()
If student.Value = True Then
i = 0
End If
End Sub
Private Sub CmdOK_Click()
'检查正确的密码
If i = 0 Then
While (UserName.Text <> Trim(Text1.Text) And Adodc1.Recordset.EOF = False)
Adodc1.Recordset.MoveNext
Wend
If UserName.Text = Trim(Text1.Text) Then
While (Password.Text <> Trim(Text2.Text) And Adodc1.Recordset.EOF = False)
Adodc1.Recordset.MoveNext
Wend
If Password.Text = Trim(Text2.Text) Then
Form2.Show
Me.Hide
Else
MsgBox ("帐户密码错误,请重试!")
End If
End If
End If
If i = 1 Then
While (UserName.Text <> Trim(Text3.Text) And Adodc2.Recordset.EOF = False)
Adodc2.Recordset.MoveNext
Wend
If UserName.Text = Trim(Text3.Text) Then
While (Password.Text <> Trim(Text4.Text) And Adodc2.Recordset.EOF = False)
Adodc2.Recordset.MoveNext
Wend
If Password.Text = Trim(Text4.Text) Then
Form5.Show
Me.Hide
Else
MsgBox "帐户密码错误,请重试!"
End If
End If
End If
End Sub
Private Sub Command3_Click()
LoginSucceeded = False
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -