📄 debarkation.frm
字号:
VERSION 5.00
Begin VB.Form pass
BackColor = &H8000000A&
Caption = "登陆"
ClientHeight = 3795
ClientLeft = 60
ClientTop = 345
ClientWidth = 5295
Icon = "Debarkation.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3795
ScaleWidth = 5295
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "登录"
Height = 1935
Left = 600
TabIndex = 5
Top = 720
Width = 3855
Begin VB.OptionButton Option1
Caption = "忘记密码 "
Height = 375
Left = 360
TabIndex = 9
Top = 1440
Width = 1095
End
Begin VB.OptionButton Option2
Caption = "找回密码"
Height = 375
Left = 2040
TabIndex = 8
Top = 1440
Width = 1095
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 0
Top = 360
Width = 1215
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 10
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 1215
End
Begin VB.Label Label1
BackColor = &H80000009&
BackStyle = 0 'Transparent
Caption = "用户名"
Height = 375
Left = 480
TabIndex = 7
Top = 360
Width = 615
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密码"
Height = 375
Left = 480
TabIndex = 6
Top = 960
Width = 615
End
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "userInformation.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 600
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "用户信息"
Top = 3360
Visible = 0 'False
Width = 3735
End
Begin VB.CommandButton Command3
Caption = "管理员"
Height = 495
Left = 3120
TabIndex = 4
Top = 2880
Width = 855
End
Begin VB.CommandButton Command2
Caption = "普通用户"
Default = -1 'True
Height = 495
Left = 1800
TabIndex = 3
Top = 2880
Width = 975
End
Begin VB.CommandButton Command1
Caption = "注册"
Height = 495
Left = 720
TabIndex = 2
Top = 2880
Width = 855
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
Height = 495
Left = 1320
TabIndex = 10
Top = 120
Width = 2775
End
End
Attribute VB_Name = "pass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Me.Hide
Register.Show
End Sub
Private Sub Command2_Click()
Dim str As String, password As String
str = Trim(Text1.Text)
password = Trim(Text2.Text)
Data1.RecordSource = "Select * From 用户信息 Where 用户名 ='" & str & "'"
Data1.Refresh
If Data1.Recordset.EOF Then
MsgBox "不存在这个用户,请先注册!", vbOKOnly + vbExclamation, "提示"
Text1.Text = "": Text2.Text = ""
Text1.SetFocus
Data1.Refresh
Else
If password <> Me.Data1.Recordset.Fields("确认密码") Then
MsgBox "你输入的密码错误,请重新再输!", vbOKOnly + vbExclamation, "错误提示"
Text2.Text = ""
Text2.SetFocus
Else
Me.Hide
MDIForm1.Show
MDIForm1.menu12.Enabled = False
MDIForm1.menu22.Enabled = False
End If
End If
End Sub
Private Sub Command3_Click()
Dim str As String, password As String
str = Trim(Text1.Text)
password = Trim(Text2.Text)
If str <> "1234" Then
Text1.Text = ""
Text1.SetFocus
Else
If Text2.Text <> "1234" Then
MsgBox "你的密码不对,请重新输入!"
Text2.Text = ""
Text2.SetFocus
Else
Me.Hide
MDIForm1.Show
End If
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text2.PasswordChar = "*"
End Sub
Private Sub Option1_Click()
Me.Hide
ForgetPassword.Show
End Sub
Private Sub Option2_Click()
Me.Hide
ModifyPassword.Show
End Sub
Private Sub Text1_LostFocus()
If Text1.Text <> "" Then
If Text1.Text <> "1234" Then
Me.Data1.RecordSource = "select 用户名 from 用户信息 where 用户名='" & Me.Text1.Text & " ' "
Me.Data1.Refresh
If Me.Data1.Recordset.EOF Then
MsgBox "对不起你没注册,请先注册再登陆!", vbOKOnly, "提示"
Text1.Text = ""
Text2.Enabled = False
Me.Data1.RecordSource = "基本情况"
Else
Text2.SetFocus
End If
Option1.Enabled = True
Option2.Enabled = True
Else
Text2.SetFocus
Option1.Enabled = False
Option2.Enabled = False
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -