?? dlgpass.frm
字號:
VERSION 5.00
Begin VB.Form DlgPass
BorderStyle = 3 'Fixed Dialog
Caption = "密碼對話框"
ClientHeight = 2445
ClientLeft = 3585
ClientTop = 3150
ClientWidth = 3960
Icon = "DlgPass.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2445
ScaleWidth = 3960
ShowInTaskbar = 0 'False
Begin VB.TextBox Text3
BackColor = &H00C0FFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 7
Top = 1200
Width = 2535
End
Begin VB.TextBox Text2
BackColor = &H00C0FFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 5
Top = 720
Width = 2535
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 270
Left = 1200
TabIndex = 3
Top = 240
Width = 2535
End
Begin VB.CommandButton CancelButton
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 1
Top = 1800
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "確定"
Default = -1 'True
Height = 375
Left = 1200
TabIndex = 0
Top = 1800
Width = 1215
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "驗證:"
Height = 180
Left = 120
TabIndex = 6
Top = 1320
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密碼:"
Height = 180
Left = 120
TabIndex = 4
Top = 840
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用戶名:"
Height = 180
Left = 120
TabIndex = 2
Top = 360
Width = 720
End
End
Attribute VB_Name = "DlgPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public addnewstate As Boolean
Public upok As Boolean
Private Sub CancelButton_Click()
Me.Hide
upok = False
End Sub
Private Sub Form_Paint()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub OKButton_Click()
On Error GoTo errh
Dim rs As New Recordset
'If addnewstate Then
If Text1.Text <> "" Then
If Text2.Text <> "" Then
If Text3.Text = Text2.Text Then
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
rs.Open "超級用戶", cn, , , adCmdTable
rs.AddNew
rs.Fields("Password").Value = Text2.Text
rs.Fields("UserName").Value = Text1.Text
rs.Update
rs.Close
Me.Hide
upok = True
MsgBox "添加成功"
Else
MsgBox "密碼錯誤,請重新輸入!"
End If
Else
MsgBox "密碼不能為空,請輸入密碼!"
End If
Else
MsgBox "用戶名不能為空"
End If
' End If
Exit Sub
errh:
MsgBox Err.Description
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -