?? frmoperator.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmOperator
BorderStyle = 3 'Fixed Dialog
Caption = "操作用戶管理< 系統管理員 >"
ClientHeight = 3645
ClientLeft = 45
ClientTop = 615
ClientWidth = 6465
Icon = "frmOperator.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3645
ScaleWidth = 6465
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmdModify
Caption = "修改(&M)"
Height = 375
Left = 2820
TabIndex = 4
Top = 2940
Width = 1110
End
Begin VB.Frame Frame1
Caption = "操作員列表"
Height = 2100
Left = 165
TabIndex = 12
Top = 1260
Width = 2385
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 1650
Left = 135
TabIndex = 6
ToolTipText = "雙擊刪除自己帳號,下次啟動時生效!"
Top = 330
Width = 2100
_ExtentX = 3704
_ExtentY = 2910
_Version = 393216
FixedCols = 0
BackColorSel = 14737632
ForeColorSel = 12582912
BackColorBkg = 12632256
AllowBigSelection= 0 'False
FocusRect = 0
ScrollBars = 2
SelectionMode = 1
AllowUserResizing= 3
End
End
Begin VB.TextBox Text1
Height = 300
Left = 3405
MaxLength = 10
TabIndex = 0
Top = 1500
Width = 2835
End
Begin VB.TextBox Text2
Height = 300
IMEMode = 3 'DISABLE
Left = 3420
MaxLength = 30
PasswordChar = "*"
TabIndex = 1
Top = 1890
Width = 2835
End
Begin VB.TextBox Text3
Height = 300
IMEMode = 3 'DISABLE
Left = 3420
MaxLength = 30
PasswordChar = "*"
TabIndex = 2
Top = 2235
Width = 2835
End
Begin VB.CommandButton Command1
Caption = "保存(S)"
Enabled = 0 'False
Height = 375
Left = 3990
TabIndex = 3
Top = 2940
Width = 1110
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "關閉(&C)"
Height = 375
Left = 5160
TabIndex = 5
Top = 2940
Width = 1110
End
Begin VB.PictureBox Picture1
BackColor = &H00C0FFFF&
Height = 750
Left = 105
ScaleHeight = 690
ScaleWidth = 6195
TabIndex = 7
Top = 180
Width = 6255
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "添加新的帳號"
ForeColor = &H000000C0&
Height = 180
Left = 2610
TabIndex = 11
Top = 150
Width = 1080
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "=> 輸入各項之后,按保存"
ForeColor = &H00000000&
Height = 180
Left = 2835
TabIndex = 10
Top = 405
Width = 1980
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "設置自己的帳號:"
ForeColor = &H000000C0&
Height = 180
Left = 150
TabIndex = 9
Top = 150
Width = 1440
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "=> 雙擊選定的帳號"
Height = 180
Left = 540
TabIndex = 8
Top = 405
Width = 1530
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 2820
TabIndex = 15
Top = 1545
Width = 615
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "口令:"
Height = 180
Left = 2820
TabIndex = 14
Top = 1950
Width = 615
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "重復:"
Height = 180
Left = 2820
TabIndex = 13
Top = 2295
Width = 615
End
Begin VB.Line Line1
X1 = 105
X2 = 6345
Y1 = 960
Y2 = 960
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
X1 = 90
X2 = 6360
Y1 = 975
Y2 = 975
End
Begin VB.Line Line3
BorderColor = &H00FFFFFF&
X1 = 2685
X2 = 6345
Y1 = 2745
Y2 = 2745
End
Begin VB.Line Line4
X1 = 2685
X2 = 6330
Y1 = 2730
Y2 = 2730
End
Begin VB.Menu MnuOperate
Caption = "操作(&O)"
Begin VB.Menu MnuAuthority
Caption = "&S 設置權限 ..."
Shortcut = ^A
End
Begin VB.Menu Line01
Caption = "-"
End
Begin VB.Menu mnuModify
Caption = "&M 修改帳號"
Shortcut = {F12}
End
Begin VB.Menu MnuDelete
Caption = "&D 刪除帳號 ..."
Shortcut = {DEL}
End
End
Begin VB.Menu MnuReturn
Caption = "返回首頁(&R)"
End
End
Attribute VB_Name = "frmOperator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DelNO As Integer, UserStr As String
Private Sub cmdModify_Click()
If Grid1.Text = "" Then
MsgBox "請選擇用戶名后再修改? ", vbInformation
Exit Sub
End If
If cmdModify.Caption = "保存(&S)" Then
cmdModify.Caption = "修改(&M)"
If Trim(Text2.Text) = Trim(Text3.Text) Then
Dim shiftStr As String, shiftStrR As Variant, shiftNum As Integer, ili As Integer, SureStr As String
shiftStr = Trim(Text2.Text)
shiftNum = Len(shiftStr)
ili = 1
SureStr = ""
For ili = 1 To shiftNum
shiftStrR = Mid(shiftStr, ili, 1)
shiftStrR = Asc(shiftStrR)
shiftStrR = shiftStrR - 3
shiftStrR = Chr(shiftStrR)
SureStr = SureStr & shiftStrR
Next
MyUpdateRecord "口令", SureStr, "操作員", Trim(Text1.Text), "Main"
Command1.Enabled = True
Command2.Enabled = True
mnuModify.Enabled = True
MnuDelete.Enabled = True
Grid1.Enabled = True
Text1.Enabled = True
ConfigGrid
Text1.Text = "": Text2.Text = "": Text3.Text = ""
Text1.SetFocus
Exit Sub
Else
MsgBox "對不起,兩次口令不一致,請重新輸入? ", vbInformation
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Exit Sub
End If
Else
cmdModify.Caption = "保存(&S)"
Text1.Text = Grid1.Text
Text1.Enabled = False
Text2.SetFocus
Command1.Enabled = False
Command2.Enabled = False
mnuModify.Enabled = False
MnuDelete.Enabled = False
Grid1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
'On Error Resume Next
'校對數據庫是否已經存在該操作員
Dim DB As Database, EF As Recordset, RecStr As String
Set DB = OpenDatabase(ConData, False, False, Constr)
Set EF = DB.OpenRecordset("Main", dbOpenDynaset)
RecStr = "操作員='" & Trim(Text1.Text) & "'"
EF.FindFirst RecStr
If Not EF.NoMatch Then
EF.Close
DB.Close
MsgBox "操作員< " & Trim(Text1.Text) & " >已經存在,不能繼續! ", vbInformation
Text1.Text = ""
Text1.SetFocus
Exit Sub
End If
EF.Close
DB.Close
'UserText = Text1.Text
'保存
'如果要加密的話,請將 Text2.text 的文本加密!
'別忘記在登錄時,要進行解密!
Dim shiftStr As String, shiftStrR As Variant, shiftNum As Integer, ili As Integer, SureStr As String
shiftStr = Trim(Text2.Text)
shiftNum = Len(shiftStr)
ili = 1
SureStr = ""
For ili = 1 To shiftNum
shiftStrR = Mid(shiftStr, ili, 1)
shiftStrR = Asc(shiftStrR)
shiftStrR = shiftStrR - 3
shiftStrR = Chr(shiftStrR)
SureStr = SureStr & shiftStrR
Next
' 插入記錄
Set DB = OpenDatabase(ConData, False, False, Constr)
RecStr = "Insert into Main (操作員,口令) values('" & Trim(Text1.Text) & "','" & Trim(SureStr) & "')"
DB.Execute RecStr
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -