📄 frmlogout.frm
字号:
VERSION 5.00
Begin VB.Form FrmLogOut
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "Logout from Billing"
ClientHeight = 2640
ClientLeft = 45
ClientTop = 405
ClientWidth = 3975
Icon = "FrmLogout.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2640
ScaleWidth = 3975
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox TxtUser
BackColor = &H00FFFFFF&
Height = 375
Left = 1560
MaxLength = 15
TabIndex = 0
Top = 840
Width = 2055
End
Begin VB.TextBox TxtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
MaxLength = 15
PasswordChar = "*"
TabIndex = 1
Top = 1320
Width = 2055
End
Begin VB.CommandButton CmdLogout
Appearance = 0 'Flat
Caption = "&Logout"
Height = 375
Left = 1560
TabIndex = 2
Top = 2040
Width = 975
End
Begin VB.CommandButton CmdBatal
Appearance = 0 'Flat
Caption = "&Batal"
Height = 375
Left = 2640
TabIndex = 3
Top = 2040
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "Password"
Height = 255
Left = 360
TabIndex = 6
Top = 1320
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Nama User"
Height = 255
Left = 360
TabIndex = 5
Top = 840
Width = 1215
End
Begin VB.Line Line1
X1 = 360
X2 = 3720
Y1 = 1800
Y2 = 1800
End
Begin VB.Shape Shape1
BackColor = &H00FFFFC0&
BorderColor = &H00E0E0E0&
BorderWidth = 2
FillColor = &H00FFFFC0&
FillStyle = 0 'Solid
Height = 1815
Left = 120
Top = 720
Width = 3735
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00008080&
BackStyle = 0 'Transparent
Caption = "Logout From Billing"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 495
Left = 1440
TabIndex = 4
Top = 120
Width = 1935
End
Begin VB.Image Image1
Height = 690
Left = 120
Picture = "FrmLogout.frx":B532
Top = 0
Width = 3750
End
End
Attribute VB_Name = "FrmLogOut"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdBatal_Click()
Unload Me
Load FrmMain
FrmMain.Show
End Sub
Private Sub CmdLogout_Click()
Call LogOut
End Sub
Private Sub TxtPassword_GotFocus()
TxtPassword.Backcolor = &HFFFF00
End Sub
Private Sub TxtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call LogOut
End If
End Sub
Private Sub TxtPassword_LostFocus()
TxtPassword.Backcolor = &HFFFFFF
End Sub
Private Sub TxtUser_GotFocus()
TxtUser.Backcolor = &HFFFF00
End Sub
Private Sub TxtUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call CekUser
End If
End Sub
Private Sub CekUser()
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT cache.* FROM cache WHERE cache.path = 'server'"
cmd.Execute
rs.ActiveConnection = cn
rs.Open "SELECT cache.* FROM cache WHERE cache.path = 'server'", cn, adOpenStatic, adLockOptimistic
If Not rs.RecordCount = 0 Then
If TxtUser.Text = rs(2) Then
TxtPassword.SetFocus
Else
MsgBox "Maaf user salah!", vbInformation, "Log Out failed!"
TxtUser.Text = ""
TxtUser.SetFocus
End If
Else
MsgBox "Cache gagal dilaksanakan", vbCritical, "Sistem Crash!"
End
End If
cn.Close
End Sub
Private Sub LogOut()
On Error GoTo error
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT account.* FROM account WHERE account.user = '" & TxtUser.Text & "'"
cmd.Execute
rs.ActiveConnection = cn
rs.Open "SELECT account.* FROM account WHERE account.user = '" & TxtUser.Text & "'", cn, adOpenStatic, adLockOptimistic
If rs.RecordCount = 0 Then
MsgBox "Nama user '" & TxtUser.Text & "' tidak diketahui.", vbInformation, "Log in Failed"
TxtUser.Text = ""
TxtPassword.Text = ""
TxtUser.SetFocus
Else
If TxtPassword.Text = DecryptText(rs(5), "password") Then
Unload Me
End
Else
MsgBox "Maaf Password anda salah!", vbInformation, "Log Out Failed"
TxtPassword.Text = ""
TxtPassword.SetFocus
End If
End If
cn.Close
error:
Select Case err.Number
Case 53
MsgBox "Aduh gagal ngecek biaya neh"
End Select
End Sub
Private Sub TxtUser_LostFocus()
TxtUser.Backcolor = &HFFFFFF
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -