📄 registerl.frm
字号:
VERSION 5.00
Begin VB.Form register
Caption = "登录"
ClientHeight = 2970
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2970
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdcancel
Caption = "退出"
Height = 465
Left = 2730
TabIndex = 6
Top = 2280
Width = 975
End
Begin VB.CommandButton cmdok
Caption = "登录"
Height = 495
Left = 1020
TabIndex = 5
Top = 2250
Width = 1035
End
Begin VB.TextBox userpassword
Height = 405
IMEMode = 3 'DISABLE
Left = 1620
PasswordChar = "*"
TabIndex = 4
Top = 1500
Width = 1965
End
Begin VB.TextBox username
Height = 375
Left = 1620
TabIndex = 3
Top = 1080
Width = 1965
End
Begin VB.Label Label3
Caption = "用户密码:"
Height = 495
Left = 750
TabIndex = 2
Top = 1590
Width = 1245
End
Begin VB.Label Label2
Caption = "用户名:"
Height = 465
Left = 930
TabIndex = 1
Top = 1170
Width = 1125
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "学生信息管理系统"
BeginProperty Font
Name = "华文行楷"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 0
Top = 330
Width = 3825
End
End
Attribute VB_Name = "register"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit '强制变量声明
Private Sub cmdok_Click()
Dim txtsql As String '用来存放SQL语句
Dim mrc As ADODB.Recordset '用来存放返回记录集对象
Dim msgtext As String '用来存放返回信息
If username.Text = "" Then
MsgBox "请输入用户名!"
username.SetFocus
Else
txtsql = "select * from user_info where user_ID='" & username.Text & "'"
Set mrc = ExecuteSQL(txtsql, msgtext) '在用户表中查找用户
If mrc.EOF Then '没找到用户,回到用户名输入框
MsgBox "没有这个用户!"
username.SetFocus
Else '找到用户,比较密码是否正确
If Trim(mrc.Fields("user_PWD")) = Trim(userpassword.Text) Then
username_OK = Trim(userpassword.Text)
Unload Me '密码正确,进行系统
frmmain.Show
Else '密码不对,重新输入
MsgBox "输入密码不对!,请重新输入"
userpassword.SetFocus
End If
End If
End If
End Sub
Private Sub cmdcancel_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -