?? 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 + -