📄 注册.frm
字号:
VERSION 5.00
Begin VB.Form 注册
Caption = "图书馆管理系统"
ClientHeight = 5160
ClientLeft = 60
ClientTop = 450
ClientWidth = 4365
LinkTopic = "Form1"
ScaleHeight = 5160
ScaleWidth = 4365
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 2160
TabIndex = 7
Top = 4200
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 480
TabIndex = 6
Top = 4200
Width = 1335
End
Begin VB.TextBox Text3
Height = 495
Left = 840
TabIndex = 2
Text = "Text3"
Top = 3240
Width = 2655
End
Begin VB.TextBox Text2
Height = 495
Left = 840
TabIndex = 1
Text = "Text2"
Top = 2040
Width = 2655
End
Begin VB.TextBox Text1
Height = 495
Left = 840
TabIndex = 0
Text = "Text1"
Top = 840
Width = 2655
End
Begin VB.Label Label3
Caption = "请重复输入密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 5
Top = 2760
Width = 1815
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
Height = 375
Left = 840
TabIndex = 4
Top = 1560
Width = 1695
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
Height = 375
Left = 840
TabIndex = 3
Top = 360
Width = 1215
End
End
Attribute VB_Name = "注册"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Len(Text1.Text) >= 16 Or Text1.Text = "" Then
MsgBox ("用户名长度错误! (1-16)")
Text1.Text = ""
Else
Set db = OpenDatabase(App.Path & "\用户管理.mdb")
Set rs = db.OpenRecordset("select 管理者名称,登陆密码 from 用户信息 where 管理者名称 = '" & Text1.Text & "'")
If rs.BOF = False And rs.EOF = False Then
MsgBox ("该名称以存在")
Text1.Text = ""
Else
If Text2.Text = Text3.Text And Text2 <> "" And Len(Text2.Text) <= 16 Then
rs.AddNew
rs("管理者名称") = Trim(Text1.Text)
rs("登陆密码") = Text2.Text
rs.Update
登陆.Combo1.Text = 登陆.Combo1.List(0)
Dim sign As Integer
sign = MsgBox(" 注册成功!" + vbCrLf + " 是否返回?", vbOKCancel, "恭喜 ^_^")
Me.Hide
登陆.Show
Unload Me
rs.Close
Else
MsgBox "密码不一致或长度超出!(1-16)," + vbCrLf + "请重新输入", , "错误! -_-!"
Text2.Text = ""
Text3.Text = ""
End If
End If
End If
End Sub
Private Sub Command2_Click()
登陆.Show
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -