📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmlogin
BorderStyle = 1 'Fixed Single
Caption = "餐饮管理系统"
ClientHeight = 4410
ClientLeft = 2730
ClientTop = 2805
ClientWidth = 8685
Icon = "frmlogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmlogin.frx":7D42
ScaleHeight = 4410
ScaleWidth = 8685
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 5280
TabIndex = 12
Top = 2640
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "取消(&F)"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6360
TabIndex = 9
Top = 3720
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定(&T)"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 8
Top = 3720
Width = 975
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 5280
MaxLength = 6
TabIndex = 6
Top = 3120
Width = 1095
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 5280
PasswordChar = "*"
TabIndex = 1
Top = 2145
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 5280
TabIndex = 0
Text = "sa"
Top = 1680
Width = 2055
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "服务器:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 4200
TabIndex = 11
Top = 2640
Width = 1020
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "验证码"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 6480
TabIndex = 10
Top = 3180
Width = 855
End
Begin VB.Label Label7
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "验证码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 240
Left = 4200
TabIndex = 7
Top = 3135
Width = 1020
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名不存在"
ForeColor = &H000000FF&
Height = 180
Left = 7560
TabIndex = 5
Top = 1800
Visible = 0 'False
Width = 1080
End
Begin VB.Label Label3
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "系统管理登陆"
BeginProperty Font
Name = "新宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 435
Left = 4200
TabIndex = 4
Top = 480
Width = 2790
End
Begin VB.Label Label2
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "密 码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 240
Left = 4200
TabIndex = 3
Top = 2160
Width = 1035
End
Begin VB.Label Label1
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 240
Left = 4200
TabIndex = 2
Top = 1680
Width = 1020
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub Label5_Click()
End
End Sub
Private Sub Command1_Click()
Dim str As String
On Error Resume Next
If Text1 <> "" Then
If Text3 = Label4.Caption Then
conn.Open "provider=sqloledb;server=" & Text4 & ";database=cygl;uid=" & Text1 & ";pwd=" & Text2 & ""
If conn.State Then
rs.Open "select groupname from qs1 where name='" & Text1 & "'", conn
If Text1 = "sa" Then
frmmain.glyxx.Visible = False
uname = Text1.Text
pubqx = "a"
frmmain.Show
Unload Me
Else
Do While Not rs.EOF
str = str + Trim(rs.Fields(0))
rs.MoveNext
Loop
Call qx(str)
uname = Text1.Text
frmmain.Show
Unload Me
End If
Else
MsgBox "用户名或密码不正确!", vbOKOnly + 48, "提示"
Text1.SetFocus
End If
Else
MsgBox "验证码错误!", vbOKOnly + 48, "提示"
End If
Else
MsgBox "用户名不能为空!", vbOKOnly + 48, "提示"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub form_Load()
If App.PrevInstance Then MsgBox "程序不能二次运行!!", vbOKOnly + vbExclamation, "提示": End
Call rnd1
End Sub
Public Sub rnd1()
Randomize
Do
a = Int(Rnd() * 1000000)
Loop Until a >= 100000
Label4.Caption = a
Text3.Text = a
End Sub
Public Sub qx(qx As String) '判断权限
If InStr(qx, "a") Then '超级管理员权限
frmmain.glyxx.Visible = False
Else
frmmain.xtgl.Visible = False
If InStr(qx, "b") = 0 Then '前台服务权限
frmmain.Toolbar1.Buttons(1).Visible = False
frmmain.Toolbar1.Buttons(2).Visible = False
frmmain.Toolbar1.Buttons(3).Visible = False
frmmain.Toolbar1.Buttons(4).Visible = False
frmmain.Toolbar1.Buttons(7).Visible = False
frmmain.Toolbar1.Buttons(8).Visible = False
frmmain.qtfw.Visible = False
End If
If InStr(qx, "c") = 0 Then '财务管理权限
frmmain.Toolbar1.Buttons(5).Visible = False
frmmain.Toolbar1.Buttons(6).Visible = False
frmmain.cwgl.Visible = False
End If
If InStr(qx, "d") = 0 Then '费用管理权限
frmmain.fydj.Visible = False
frmmain.fycx.Visible = False
frmmain.gzdj.Visible = False
End If
If InStr(qx, "e") = 0 Then '库存管理权限
frmmain.kcgl.Visible = False
frmmain.Toolbar1.Buttons(9).Visible = False
End If
If InStr(qx, "f") = 0 Then '系统初始化权限
frmmain.xtgl.Visible = False
End If
If InStr(qx, "g") = 0 Then '工资查询(普通员工)
frmmain.gzcx.Visible = False
End If
End If
pubqx = qx
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -