📄 frmpasswordadmin.frm
字号:
VERSION 5.00
Begin VB.Form FrmPasswordAdmin
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "Password Root client"
ClientHeight = 2985
ClientLeft = 45
ClientTop = 390
ClientWidth = 3960
Icon = "FrmPasswordAdmin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2985
ScaleWidth = 3960
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton CmdBatal
Caption = "Batal"
Height = 495
Left = 2640
TabIndex = 3
Top = 2160
Width = 1095
End
Begin VB.CommandButton CmdSet
Caption = "Simpan"
Height = 495
Left = 1320
TabIndex = 2
Top = 2160
Width = 1095
End
Begin VB.TextBox TxtPassword
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00B54524&
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 0
Top = 840
Width = 1935
End
Begin VB.TextBox TxtPassword1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00B54524&
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 1
Top = 1320
Width = 1935
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Password"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00B54524&
Height = 255
Left = 240
TabIndex = 6
Top = 840
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "Ulangi Password"
BeginProperty Font
Name = "OCR-A BT"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00B54524&
Height = 255
Left = 240
TabIndex = 5
Top = 1320
Width = 1575
End
Begin VB.Line Line1
BorderColor = &H8000000A&
X1 = 480
X2 = 3720
Y1 = 2040
Y2 = 2040
End
Begin VB.Label Label25
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Set Password Root Client"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 255
Left = 1200
TabIndex = 4
Top = 240
Width = 2655
End
Begin VB.Image Image1
Height = 690
Left = 120
Picture = "FrmPasswordAdmin.frx":B532
Top = 0
Width = 3750
End
Begin VB.Shape Shape1
BackColor = &H00FFFFC0&
BorderColor = &H00E0E0E0&
BorderWidth = 2
FillColor = &H00FFFFC0&
FillStyle = 0 'Solid
Height = 2175
Left = 120
Top = 720
Width = 3735
End
End
Attribute VB_Name = "FrmPasswordAdmin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub SetPassword()
On Error Resume Next
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT admin.* FROM admin"
cmd.Execute
rs.ActiveConnection = cn
rs.Open "SELECT admin.* FROM admin", cn, adOpenStatic, adLockOptimistic
If Not rs.RecordCount = 0 Then
rs.MoveFirst
rs(0) = EncryptText(TxtPassword.Text, "password")
rs.Update
Else
rs.AddNew
rs(0) = EncryptText(TxtPassword.Text, "password")
rs.Update
End If
cn.Close
MsgBox "Setting password root telah selesai", vbInformation, "Update Konfigurasi"
password_admin = TxtPassword.Text
Unload Me
End Sub
Private Sub CmdBatal_Click()
Unload Me
End Sub
Private Sub CmdSet_Click()
On Error Resume Next
If TxtPassword.Text <> "" Then
If TxtPassword = TxtPassword1 Then
Call SetPassword
Else
TxtPassword.Text = ""
TxtPassword1.Text = ""
MsgBox "Maaf antara password 1 dan 2 tidak sama!", vbInformation
TxtPassword.SetFocus
End If
Else
MsgBox "Maaf Pasword harus diisi", vbInformation
TxtPassword.SetFocus
End If
End Sub
Private Sub TxtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtPassword1.SetFocus
End If
End Sub
Private Sub TxtPassword1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
CmdSet.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -