📄 frmsetpassword.frm
字号:
VERSION 5.00
Begin VB.Form FrmSetPassword
BackColor = &H00EFF2EC&
BorderStyle = 1 'Fixed Single
Caption = "Set Root Password"
ClientHeight = 2700
ClientLeft = 45
ClientTop = 390
ClientWidth = 4710
Icon = "FrmSetPassword.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2700
ScaleWidth = 4710
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox TxtUser
Height = 375
Left = 1680
Locked = -1 'True
TabIndex = 0
Top = 480
Width = 2415
End
Begin VB.TextBox TxtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 2415
End
Begin VB.TextBox TxtPasswordLagi
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 2
Top = 1440
Width = 2415
End
Begin VB.CommandButton CmdOK
Caption = "OK"
Height = 495
Left = 2640
TabIndex = 3
Top = 1920
Width = 1455
End
Begin VB.Frame Frame1
Height = 2415
Left = 120
TabIndex = 4
Top = 120
Width = 4455
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "Ulangi 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 = 7
Top = 1320
Width = 1695
End
Begin VB.Label Label5
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 = 1455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "Nama User"
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 = 5
Top = 360
Width = 1455
End
End
End
Attribute VB_Name = "FrmSetPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click()
Createpass
End Sub
Private Sub Form_Activate()
On Error Resume Next
TxtUser.Text = "root"
End Sub
Private Sub TxtPassword_Change()
On Error Resume Next
If Not (TxtPassword.Text = "" Or TxtPasswordLagi.Text = "") Then
CmdOK.Enabled = True
Else
CmdOK.Enabled = False
End If
End Sub
Private Sub TxtPassword_GotFocus()
On Error Resume Next
TxtPassword.Backcolor = &HFFFF00
End Sub
Private Sub TxtPassword_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
If TxtPassword.Text <> "" Then
TxtPasswordLagi.SetFocus
End If
End If
End Sub
Private Sub Createpass()
On Error Resume Next
Dim passwd As String
If TxtPassword.Text = TxtPasswordLagi.Text Then
passwd = EncryptText(TxtPassword.Text, "password")
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "INSERT INTO account([user],[nama],[login],[alamat],[telp],[password]) VALUES ('root','root','root','blackpearl','blackpearl','" & passwd & "')"
cmd.Execute
MsgBox "Password telah di simpan. restart billing untuk menjalankan program dan konfigurasi selanjutnya.", vbInformation, "Dump database user"
Unload Me
End
Else
MsgBox "Maaf antara password 1 dan 2 tidak sama.", vbInformation, "Set Password"
TxtPassword.Text = ""
TxtPasswordLagi.Text = ""
TxtPassword.SetFocus
End If
End Sub
Private Sub TxtPassword_LostFocus()
TxtPassword.Backcolor = &HFFFFFF
End Sub
Private Sub TxtPasswordLagi_Change()
On Error Resume Next
If Not (TxtPassword.Text = "" Or TxtPasswordLagi.Text = "") Then
CmdOK.Enabled = True
Else
CmdOK.Enabled = False
End If
End Sub
Private Sub TxtPasswordLagi_GotFocus()
TxtPasswordLagi.Backcolor = &HFFFF00
End Sub
Private Sub TxtPasswordLagi_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
If Not TxtPasswordLagi.Text = "" Then
Createpass
End If
End If
End Sub
Private Sub TxtPasswordLagi_LostFocus()
TxtPasswordLagi.Backcolor = &HFFFFFF
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -