📄 form2.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form2
BackColor = &H00FFC0C0&
Caption = "南方医科大学宿舍管理系统"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form2"
ScaleHeight = 12840
ScaleWidth = 21480
StartUpPosition = 3 '窗口缺省
WindowState = 2 'Maximized
Begin VB.PictureBox Picture2
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 7575
Left = 840
Picture = "Form2.frx":0000
ScaleHeight = 7575
ScaleWidth = 1575
TabIndex = 9
Top = 720
Width = 1575
End
Begin VB.CommandButton Command3
BackColor = &H00C0FFC0&
Caption = "退出登陆"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 9720
Style = 1 'Graphical
TabIndex = 8
Top = 9840
Width = 1335
End
Begin VB.CommandButton Command4
BackColor = &H00C0FFC0&
Caption = "立即登陆"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6000
MaskColor = &H8000000F&
Style = 1 'Graphical
TabIndex = 7
Top = 9840
Width = 1335
End
Begin VB.TextBox txtpassword
BackColor = &H00C0FFFF&
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 390
IMEMode = 3 'DISABLE
Left = 7080
PasswordChar = "*"
TabIndex = 3
Top = 8880
Width = 2175
End
Begin VB.TextBox txtusername
BackColor = &H00C0FFFF&
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 390
IMEMode = 3 'DISABLE
Left = 2880
TabIndex = 2
Top = 8880
Width = 2175
End
Begin VB.ComboBox Combo1
BackColor = &H00C0FFFF&
Height = 300
ItemData = "Form2.frx":2B6A2
Left = 11400
List = "Form2.frx":2B6AC
TabIndex = 1
Text = "请选择身份"
Top = 8880
Width = 1935
End
Begin VB.PictureBox Picture1
Height = 8295
Left = 2880
Picture = "Form2.frx":2B6BE
ScaleHeight = 8235
ScaleWidth = 11595
TabIndex = 0
Top = 240
Width = 11655
Begin VB.TextBox Text1
DataSource = "Adodc1"
Height = 495
Left = 1560
TabIndex = 12
Text = "Text1"
Top = 3720
Visible = 0 'False
Width = 3375
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1920
TabIndex = 11
Top = 4320
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 495
Left = 3600
TabIndex = 10
Top = 4320
Visible = 0 'False
Width = 1335
End
Begin MSAdodcLib.Adodc Adodc1
Height = 615
Left = 1800
Top = 4920
Visible = 0 'False
Width = 3495
_ExtentX = 6165
_ExtentY = 1085
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 = ""
OLEDBString = ""
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
End
Begin VB.Label Label5
BackColor = &H00FFC0C0&
Caption = "用户名(U):"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 390
Left = 1320
TabIndex = 6
Top = 8880
Width = 1335
End
Begin VB.Label Label6
BackColor = &H00FFC0C0&
Caption = "密码(P):"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 390
Left = 5640
TabIndex = 5
Top = 8880
Width = 1335
End
Begin VB.Label Label7
BackColor = &H00FFC0C0&
Caption = "选择身份:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 9720
TabIndex = 4
Top = 8880
Width = 1335
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public stu_adm As Integer
Public myuser As String
Private Sub Command3_Click()
'Unload Me
'Form1.Show
End
End Sub
Private Sub Command4_Click()
Dim strSq1 As String
Dim a As String
Static count As Integer
If Combo1.Text = "管理员" And txtusername = "admin" And txtpassword = "1234" Then
Unload Me
Form1.Show
stu_adm = 1
ElseIf Combo1.Text = "学生" Then
'用VB内嵌的查询语句查询
Dim s As Variant
With Adodc1.Recordset
s = .Bookmark
.Find "学号 like '" & txtusername.Text & "'"
If .EOF Or Text1.Text <> txtpassword.Text Then
MsgBox "对不起,用户名或密码有误,请重新输入!"
.Bookmark = s '当查找失败时,快速返回到查找前的记录
Else '如果用户名正确,再判断密码
' MsgBox "正确"
myuser = txtusername.Text
stu_adm = 2
Unload Me
geren.Show
End If
End With
Else
count = count + 1
If (count >= 3) Then
txtpassword.Enabled = False
Combo1.Enabled = False
MsgBox "输入次数过多,禁止使用!"
End If
MsgBox "不能登录,请正确输入用户,密码和选择身份"
End If
End Sub
Private Sub Command1_Click()
Adodc1.Recordset.MovePrevious
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.MoveNext
End Sub
Private Sub Command5_Click()
If Form2.Combo1.Text = "学生" Then
'Unload Me
'Form3.Show
MsgBox "stu"
ElseIf Form2.Combo1.Text = "管理员" Then
MsgBox "stu"
End If
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\ss.mdb"
Adodc1.RecordSource = "密码表"
Text1.DataField = "密码"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -