📄 frm_login.frm
字号:
VERSION 5.00
Begin VB.Form frm_login
BorderStyle = 0 'None
Caption = "登录界面"
ClientHeight = 10200
ClientLeft = 300
ClientTop = 315
ClientWidth = 14235
Icon = "frm_login.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
Picture = "frm_login.frx":0442
ScaleHeight = 10200
ScaleWidth = 14235
ShowInTaskbar = 0 'False
WindowState = 2 'Maximized
Begin VB.TextBox txt_passwd
DataSource = "Adodc1"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 6840
PasswordChar = "*"
TabIndex = 1
Top = 5520
Width = 3255
End
Begin VB.TextBox txt_name
DataSource = "Adodc1"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6840
TabIndex = 0
Top = 4440
Width = 3255
End
Begin VB.Image img_cancle
Height = 690
Left = 8880
Picture = "frm_login.frx":31EAD
Top = 7800
Width = 1770
End
Begin VB.Image img_ok
Height = 690
Left = 6960
Picture = "frm_login.frx":35CFA
Top = 7800
Width = 1770
End
Begin VB.Image img_help
Height = 690
Left = 5040
Picture = "frm_login.frx":39B87
Top = 7800
Width = 1770
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
X1 = 7695
X2 = 7695
Y1 = 9000
Y2 = 9480
End
Begin VB.Line Line1
BorderColor = &H8000000C&
X1 = 7680
X2 = 7680
Y1 = 9000
Y2 = 9480
End
Begin VB.Label lab_time
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "time"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 8040
TabIndex = 3
Top = 9120
Width = 375
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "系统当前时间"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 6120
TabIndex = 2
Top = 9120
Width = 1080
End
End
Attribute VB_Name = "frm_login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public ok As Boolean
Dim logtrycount As Integer
Private Sub Form_Load()
ok = False
logtrycount = 0
lab_time.Caption = Now
End Sub
Private Sub img_cancle_Click()
ok = False
End
End Sub
Private Sub img_cancle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
img_cancle.Top = 7830
End Sub
Private Sub img_cancle_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
img_cancle.Top = 7800
End Sub
Private Sub img_help_Click()
'CommonDialog1.ShowHelp
End Sub
Private Sub img_help_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
img_help.Top = 7830
End Sub
Private Sub img_help_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
img_help.Top = 7800
End Sub
Private Sub img_ok_Click()
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
username = ""
If Not Testtxt(txt_name.Text) Then
MsgBox "请输入姓名和密码", vbOKOnly + vbExclamation, "提示"
txt_name.SetFocus
Else
txtSQL = "select * from 系统用户表 where 用户名='" & Trim(txt_name.Text) & " '"
Set mrc = ExecuteSql(txtSQL, MsgText)
If mrc.EOF = True Then
MsgBox "没有此用户,请重输", vbOKOnly + vbExclamation, "提示"
txt_name.SetFocus
Else
If Trim(mrc.Fields(2)) = Trim(txt_passwd.Text) Then
ok = True
username = Trim(txt_name.Text)
frm_mainconsole.Show
'frm_ordering.Show
mrc.Close
Unload Me
Else
MsgBox "密码错误,请重输", vbOKOnly + vbExclamation, "提示"
txt_passwd.SetFocus
txt_passwd.Text = ""
End If
End If
End If
logtrycount = logtrycount + 1
If logtrycount = 3 Then
Unload Me
End If
Exit Sub
End Sub
Private Sub img_ok_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
img_ok.Top = 7830
End Sub
Private Sub img_ok_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
img_ok.Top = 7800
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -