📄 regist_frm.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form regist_frm
Caption = "注册用户"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 2280
Top = 2280
Visible = 0 'False
Width = 2160
_ExtentX = 3810
_ExtentY = 661
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 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\VB实习\db1.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\VB实习\db1.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "pwd"
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.CommandButton Command2
Cancel = -1 'True
Caption = "返回"
Height = 375
Left = 2520
TabIndex = 7
Top = 2640
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确定"
Default = -1 'True
Height = 375
Left = 360
TabIndex = 6
Top = 2640
Width = 1335
End
Begin VB.TextBox newpwd1
DataSource = "Adodc1"
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 5
Top = 1080
Width = 2775
End
Begin VB.TextBox newpwd2
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 1
Top = 1800
Width = 2775
End
Begin VB.TextBox newuser
DataSource = "Adodc1"
Height = 375
Left = 1440
TabIndex = 0
Top = 360
Width = 2775
End
Begin VB.Label Label3
Caption = "再输入密码"
Height = 375
Left = 240
TabIndex = 4
Top = 1800
Width = 1095
End
Begin VB.Label Label2
Caption = "新密码"
Height = 375
Left = 240
TabIndex = 3
Top = 1080
Width = 1095
End
Begin VB.Label Label1
Caption = "新用户名"
Height = 375
Left = 240
TabIndex = 2
Top = 360
Width = 975
End
End
Attribute VB_Name = "regist_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If newuser <> "" And newpwd1 <> "" And newpwd2 <> "" Then
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields(0) = newuser.Text Then
MsgBox "用户已存在!"
newuser = ""
newpwd1 = ""
newpwd2 = ""
newuser.SetFocus
Exit Do
ElseIf newpwd1 <> newpwd2 Then
MsgBox "两次输入密码不一致!请重新输入!"
newpwd1 = ""
newpwd2 = ""
newpwd1.SetFocus
Exit Do
Else
Adodc1.Recordset.MoveLast
Adodc1.Recordset.MoveNext
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0) = newuser.Text
Adodc1.Recordset.Fields(1) = newpwd1.Text
MsgBox "注册成功!"
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Unload Me
Exit Do
Adodc1.Recordset.MoveNext
End If
Loop
Else
MsgBox "密码或用户名不能为空!"
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
regist_frm.Show
newuser.SetFocus
newuser = ""
newpwd1 = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -