📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 1 'Fixed Single
ClientHeight = 2475
ClientLeft = 3495
ClientTop = 3060
ClientWidth = 4935
ControlBox = 0 'False
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2475
ScaleWidth = 4935
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2355
Left = 60
ScaleHeight = 2325
ScaleWidth = 4785
TabIndex = 1
Top = 60
Width = 4815
Begin sell.xpcmdbutton cmdCancel
Height = 465
Left = 2730
TabIndex = 6
Top = 1590
Width = 1395
_ExtentX = 2461
_ExtentY = 820
Caption = "取 消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin sell.xpcmdbutton cmdEnter
Height = 465
Left = 930
TabIndex = 5
Top = 1590
Width = 1395
_ExtentX = 2461
_ExtentY = 820
Caption = "登 陆"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.ComboBox cobUser
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1920
Style = 2 'Dropdown List
TabIndex = 0
Top = 300
Width = 2205
End
Begin VB.TextBox txtPWD
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 2
Top = 840
Width = 2205
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 990
TabIndex = 4
Top = 840
Width = 630
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用 户"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 990
TabIndex = 3
Top = 360
Width = 630
End
Begin VB.Line Line1
BorderColor = &H00808080&
BorderWidth = 2
X1 = 210
X2 = 4560
Y1 = 1410
Y2 = 1410
End
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdEnter_Click()
If cobUser.ListIndex = -1 Then Exit Sub
Dim Rst As ADODB.Recordset
Dim Cmd As ADODB.Command
Dim SQL As String
Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
SQL = "select purview from [user] where username='" & cobUser.Text & "' and password='" & txtPWD.Text & "'"
Rst.Open SQL, Conn, adOpenDynamic, adLockReadOnly, adCmdText
If Rst.EOF Then
Rst.Close
Set Rst = Nothing
MsgBox "您输入的密码不正确!", 64
txtPWD.SelStart = 0
txtPWD.SelLength = Len(txtPWD.Text)
txtPWD.SetFocus
Exit Sub
End If
Rst.Close
UserName = cobUser.Text
Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
Rst.Open "sysset", Conn, adOpenDynamic, adLockReadOnly, adCmdTable
SysCaption = Rst.Fields(0)
PrintHat = Rst.Fields(1)
PrintEnd = Rst.Fields(2)
IsPrint = Rst.Fields(3)
Set Cmd = New ADODB.Command
Cmd.ActiveConnection = Conn
Cmd.CommandText = "update logon set username='" & UserName & "' where ip='" & IP & "'"
Cmd.CommandType = adCmdText
Cmd.Execute
Set Cmd = Nothing
Rst.Close
Set Rst = Nothing
Unload Me
frmSell.Show
End Sub
Private Sub cobUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtPWD.SetFocus
End Sub
Private Sub Form_Load()
Dim Rst As ADODB.Recordset
Dim I As Integer
Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
Rst.Open "select username from [user]", Conn, adOpenStatic, adLockReadOnly, adCmdText
If Rst.EOF Then Exit Sub
For I = 1 To Rst.RecordCount
cobUser.AddItem Rst.Fields(0)
Rst.MoveNext
Next
Rst.Close
Set Rst = Nothing
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set frmLogin = Nothing
End Sub
Private Sub txtPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdEnter_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -