📄 forlogin.frm
字号:
VERSION 5.00
Begin VB.Form ForLogin
Caption = "登陆框"
ClientHeight = 5265
ClientLeft = 60
ClientTop = 435
ClientWidth = 7320
LinkTopic = "Form1"
ScaleHeight = 5265
ScaleWidth = 7320
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox Picture5
BorderStyle = 0 'None
Height = 495
Left = 5880
Picture = "ForLogin.frx":0000
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 13
Top = 4440
Width = 495
End
Begin VB.PictureBox Picture4
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 495
Left = 840
Picture = "ForLogin.frx":08CA
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 12
Top = 4440
Width = 495
End
Begin VB.CommandButton Command2
BackColor = &H00FFC0FF&
Caption = "取消"
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 = 3960
Style = 1 'Graphical
TabIndex = 9
Top = 4440
Width = 1695
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0FF&
Caption = "确定"
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 = 1440
Style = 1 'Graphical
TabIndex = 8
Top = 4440
Width = 1695
End
Begin VB.Frame Frame1
BackColor = &H00FFC0FF&
Caption = "登陆系统"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2655
Left = 840
TabIndex = 1
Top = 1440
Width = 5535
Begin VB.PictureBox Picture3
BackColor = &H00FFC0FF&
BorderStyle = 0 'None
Height = 615
Left = 480
Picture = "ForLogin.frx":1194
ScaleHeight = 615
ScaleWidth = 615
TabIndex = 11
Top = 1920
Width = 615
End
Begin VB.PictureBox Picture2
BackColor = &H00FFC0FF&
BorderStyle = 0 'None
Height = 735
Left = 480
Picture = "ForLogin.frx":1A5E
ScaleHeight = 735
ScaleWidth = 735
TabIndex = 10
Top = 1080
Width = 735
End
Begin VB.TextBox txtPassword
BackColor = &H00C0FFFF&
Height = 375
IMEMode = 3 'DISABLE
Left = 2520
PasswordChar = "*"
TabIndex = 7
Text = "Text2"
Top = 1920
Width = 1455
End
Begin VB.TextBox txtUserName
BackColor = &H00C0FFFF&
Height = 375
Left = 2520
TabIndex = 6
Text = "Text1"
Top = 1320
Width = 1455
End
Begin VB.OptionButton Option2
BackColor = &H00FFC0FF&
Caption = "前台售票员"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 3240
TabIndex = 3
Top = 360
Width = 2055
End
Begin VB.OptionButton Option1
BackColor = &H00FFC0FF&
Caption = "后台管理人"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 720
TabIndex = 2
Top = 480
Width = 2055
End
Begin VB.Label Label3
BackColor = &H00FFC0FF&
Caption = "密 码"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 5
Top = 1920
Width = 735
End
Begin VB.Label Label2
BackColor = &H00FFC0FF&
Caption = "用户名"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 4
Top = 1320
Width = 855
End
End
Begin VB.PictureBox Picture1
BackColor = &H0080FFFF&
BorderStyle = 0 'None
FillColor = &H00C0FFFF&
FillStyle = 2 'Horizontal Line
Height = 495
Left = 840
Picture = "ForLogin.frx":2928
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 0
Top = 480
Width = 495
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "欢迎进入火车订购票系统"
BeginProperty Font
Name = "黑体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800080&
Height = 495
Left = 1560
TabIndex = 14
Top = 600
Width = 4455
End
Begin VB.Image Image1
Height = 11520
Left = -7440
Picture = "ForLogin.frx":2C32
Top = -240
Width = 15360
End
End
Attribute VB_Name = "ForLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public UserType As String
Public UserName As String
Public BookTicketRight As Integer
Public SaleTicketRight As Integer
Public BackTicketRight As Integer
Public TrainUpdateRight As Integer
Public TicketUpdateRight As Integer
Public Count1Right As Integer
Public Count2Right As Integer
Public Count3Right As Integer
Public SetRight As Integer
Public SetSecretRight As Integer
Public BackTicketInfoRight As Integer
Public SeledTicketInfoRight As Integer
Private Sub Command1_Click()
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
If UserType = "" Then
MsgBox "请选择用户类型!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(txtUserName.Text = "") Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
txtSQL = "select * from 用户信息表 where 用户姓名='" & txtUserName.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If Trim(mrc.Fields(3)) = Trim(txtPassword.Text) And (Trim(mrc.Fields(2)) = UserType) Then
OK = True
UserName = Trim(txtUserName.Text)
BookTicketRight = mrc.Fields(4).Value
SaleTicketRight = mrc.Fields(5).Value
BackTicketRight = mrc.Fields(6).Value
TrainUpdateRight = mrc.Fields(7).Value
TicketUpdateRight = mrc.Fields(8).Value
Count1Right = mrc.Fields(9).Value
Count2Right = mrc.Fields(10).Value
Count3Right = mrc.Fields(11).Value
SetRight = mrc.Fields(12).Value
SetSecretRight = mrc.Fields(13).Value
BackTicketInfoRight = mrc.Fields(14).Value
SeledTicketInfoRight = mrc.Fields(15).Value
mrc.Close
Me.Hide
ForMain.Show
Else
MsgBox "密码错误,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
End If
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
txtUserName = ""
txtPassword = ""
End Sub
Private Sub Option1_Click()
UserType = "后台管理人"
End Sub
Private Sub Option2_Click()
UserType = "操作员"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -