📄 frmmang.frm
字号:
VERSION 5.00
Begin VB.Form frmmang
BackColor = &H00FF7722&
BorderStyle = 3 'Fixed Dialog
Caption = "用户管理"
ClientHeight = 3615
ClientLeft = 45
ClientTop = 330
ClientWidth = 5115
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 241
ScaleMode = 3 'Pixel
ScaleWidth = 341
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox aa
Height = 270
Left = 720
TabIndex = 17
Text = "Text6"
Top = 3960
Width = 735
End
Begin VB.CommandButton cmdend
Caption = "退出"
Height = 375
Left = 3360
TabIndex = 16
Top = 3000
Width = 1095
End
Begin VB.CommandButton cmdok
Caption = "确定"
Height = 375
Left = 2160
TabIndex = 15
Top = 3000
Width = 975
End
Begin VB.OptionButton opdel
Appearance = 0 'Flat
BackColor = &H00FF7722&
Caption = "清除资料"
ForeColor = &H00FFFFFF&
Height = 255
Left = 480
TabIndex = 14
Top = 3240
Width = 1095
End
Begin VB.OptionButton opch
Appearance = 0 'Flat
BackColor = &H00FF7722&
Caption = "修改密码"
ForeColor = &H00FFFFFF&
Height = 255
Left = 480
TabIndex = 13
Top = 2880
Value = -1 'True
Width = 1095
End
Begin VB.Frame fradel
BackColor = &H00FF7722&
Caption = "清除资料"
Enabled = 0 'False
ForeColor = &H00FFFFFF&
Height = 2700
Left = 2760
TabIndex = 1
Top = 120
Width = 2175
Begin VB.Label Label7
BackColor = &H00FF7722&
Caption = "注意!您一旦执行选择了“清除资料”,您的用户名、密码及全部资料都会被清除,请慎重选择此选项!"
ForeColor = &H00FFFFFF&
Height = 2295
Left = 120
TabIndex = 18
Top = 240
Width = 1935
End
End
Begin VB.Frame frach
BackColor = &H00FF7722&
Caption = "修改密码"
ForeColor = &H00FFFFFF&
Height = 2700
Left = 120
TabIndex = 0
Top = 120
Width = 2535
Begin VB.TextBox txtans
Appearance = 0 'Flat
BackColor = &H00FF7722&
ForeColor = &H00FFFFFF&
Height = 270
Left = 960
TabIndex = 11
Top = 1680
Width = 1500
End
Begin VB.TextBox txtque
Appearance = 0 'Flat
BackColor = &H00FF7722&
ForeColor = &H00FFFFFF&
Height = 270
Left = 960
TabIndex = 10
Top = 1320
Width = 1500
End
Begin VB.TextBox txtrepwd
Appearance = 0 'Flat
BackColor = &H00FF7722&
ForeColor = &H00FFFFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 9
Top = 960
Width = 1500
End
Begin VB.TextBox txtnpwd
Appearance = 0 'Flat
BackColor = &H00FF7722&
ForeColor = &H00FFFFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 8
Top = 600
Width = 1500
End
Begin VB.TextBox txtopwd
Appearance = 0 'Flat
BackColor = &H00FF7722&
ForeColor = &H00FFFFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 7
Top = 240
Width = 1500
End
Begin VB.Label Label6
BackColor = &H00FF7722&
Caption = "提示:如果只更改密码,则""提示问题""及""答案""可以不填."
ForeColor = &H00FFFFFF&
Height = 405
Left = 120
TabIndex = 12
Top = 2160
Width = 2295
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H00FF7722&
Caption = "答 案"
ForeColor = &H00FFFFFF&
Height = 180
Left = 120
TabIndex = 6
Top = 1730
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00FF7722&
Caption = "提示问题"
ForeColor = &H00FFFFFF&
Height = 180
Left = 120
TabIndex = 5
Top = 1370
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00FF7722&
Caption = "再填一次"
ForeColor = &H00FFFFFF&
Height = 180
Left = 120
TabIndex = 4
Top = 1010
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00FF7722&
Caption = "新 密 码"
ForeColor = &H00FFFFFF&
Height = 180
Left = 120
TabIndex = 3
Top = 650
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FF7722&
Caption = "旧 密 码"
ForeColor = &H00FFFFFF&
Height = 180
Left = 120
TabIndex = 2
Top = 290
Width = 720
End
End
End
Attribute VB_Name = "frmmang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rst As ADODB.Recordset
Dim mycnn As ADODB.Connection
Dim str As String
Dim bl As Boolean
Private Sub cmdend_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
Dim cmd As ADODB.Command
aa.SetFocus
If bl Then
If txtopwd = "" Or txtnpwd = "" Or txtrepwd = "" Then
MsgBox "请填写密码!", vbOKOnly + vbExclamation, "提示"
txtopwd = ""
txtnpwd = ""
txtrepwd = ""
Exit Sub
End If
If txtnpwd <> txtrepwd Then
MsgBox "两次填写的密码不同!", vbOKOnly + vbExclamation, "提示"
txtopwd = ""
txtnpwd = ""
txtrepwd = ""
Exit Sub
End If
rst!pwd = txtnpwd.Text
If txtque <> "" And txtans <> "" Then
rst!que = txtque.Text
rst!ans = txtans.Text
Else
If txtque <> "" And txtans = "" Or txtque = "" And txtans <> "" Then
MsgBox "提示问题和答案必须全部填写!", vbOKOnly + vbExclamation, "提示"
End If
End If
If MsgBox("确定要更改吗?", vbYesNo + vbQuestion + vbDefaultButton2, "提示") = vbYes Then
rst.Update
Else
rst.CancelUpdate
End If
Else
If MsgBox("真的要删除全部资料吗?(此过程不可逆)", vbYesNo + vbQuestion + vbDefaultButton2, "提示") = vbYes Then
rst.Delete
rst.Update
rst.Close
Set rst = Nothing
Set rst = New ADODB.Recordset
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.CursorLocation = adUseClient
rst.Open "delete * from firend where owner='" & struser & "'", mycnn, , , adCmdText
MsgBox "您的全部资料已经清除,感谢您使用本软件!", vbOKOnly + vbInformation, "提示"
End
End If
End If
End Sub
Private Sub Form_Load()
bl = True
str = "provider=microsoft.jet.oledb.4.0;" _
& "data source=" & App.Path & "\data\data.mdb"
Set mycnn = New ADODB.Connection
mycnn.Open str
Set rst = New ADODB.Recordset
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.CursorLocation = adUseClient
rst.Open "select * from pass where id='" & struser & "'", mycnn, , , adCmdText
End Sub
Private Sub Form_Unload(Cancel As Integer)
rst.Close
mycnn.Close
Set rst = Nothing
Set mycnn = Nothing
End Sub
Private Sub opch_Click()
aa.SetFocus
bl = True
frach.Enabled = True
fradel.Enabled = False
End Sub
Private Sub opdel_Click()
aa.SetFocus
bl = False
fradel.Enabled = True
frach.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -