📄 注册.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "注册新用户"
ClientHeight = 5310
ClientLeft = 60
ClientTop = 345
ClientWidth = 7125
LinkTopic = "Form1"
ScaleHeight = 5310
ScaleWidth = 7125
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3840
TabIndex = 8
Top = 3840
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1560
TabIndex = 7
Top = 3840
Width = 1215
End
Begin VB.TextBox Text3
Height = 495
IMEMode = 3 'DISABLE
Left = 3840
PasswordChar = "*"
TabIndex = 6
Top = 2880
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 3840
PasswordChar = "*"
TabIndex = 5
Top = 2040
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 3840
TabIndex = 4
Top = 1200
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 720
Top = 4560
Visible = 0 'False
Width = 4215
_ExtentX = 7435
_ExtentY = 1296
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=是杂点"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "是杂点"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 用户表"
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.Label Label4
Alignment = 2 'Center
Caption = "确认密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1320
TabIndex = 3
Top = 2880
Width = 1215
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "输入密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1320
TabIndex = 2
Top = 2160
Width = 1215
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1320
TabIndex = 1
Top = 1320
Width = 1215
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "新用户注册"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1320
TabIndex = 0
Top = 480
Width = 4455
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sqlstr As String
If Text1.Text = "" Then
MsgBox "请输入用户名!", vbExclamation, "确认密码"
Text1.SetFocus
Exit Sub
Else
sqlstr = "select * from 用户表 where 用户名='" & Text1 & "'"
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
If Adodc1.Recordset.EOF = False Then
MsgBox "用户已存在,请重新输入!", vbExclamation, "检验用户名"
Text1 = ""
Text1.SetFocus
Exit Sub
End If
End If
If Text2 <> Text3 Then
MsgBox "两输入的密码不一致,请重新输入", vbExclamation, "检验密码"
Text2 = ""
Text3 = ""
Exit Sub
ElseIf Text2 = "" Then
MsgBox "密码不能为空!", vbExclamation, "检验密码"
Text2.SetFocus
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("用户名") = Trim(Text1)
Adodc1.Recordset.Fields("密码") = Trim(Text2)
Adodc1.Recordset.Update
Me.Hide
MsgBox "成功注册新用户!", vbInformation, "添加用户"
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -