⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 餐饮茶馆管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
Begin VB.Form frmSplash 
   BackColor       =   &H000080FF&
   Caption         =   "餐饮茶馆控制系统"
   ClientHeight    =   6375
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7455
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   6375
   ScaleWidth      =   7455
   StartUpPosition =   3  '窗口缺省
   Begin Threed.SSCommand cmdOK 
      Height          =   360
      Left            =   4995
      TabIndex        =   2
      Top             =   1305
      Width           =   1125
      _Version        =   65536
      _ExtentX        =   1984
      _ExtentY        =   635
      _StockProps     =   78
      Caption         =   "确定(&O)"
      BevelWidth      =   1
      Font3D          =   3
   End
   Begin VB.ComboBox UserTxt 
      Height          =   300
      Left            =   5745
      TabIndex        =   0
      Top             =   480
      Width           =   1500
   End
   Begin VB.TextBox txtPassword 
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   5745
      MaxLength       =   30
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   840
      Width           =   1500
   End
   Begin Threed.SSPanel SSPanel1 
      Height          =   360
      Left            =   -15
      TabIndex        =   4
      Top             =   6015
      Width           =   7500
      _Version        =   65536
      _ExtentX        =   13229
      _ExtentY        =   635
      _StockProps     =   15
      Caption         =   "东化计算机科技有限公司    电话:0577-8269005 8269007 donghua@mail.wzptt.zj.cn"
      BackColor       =   12632256
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Font3D          =   3
   End
   Begin Threed.SSCommand cmdCancel 
      Cancel          =   -1  'True
      Height          =   360
      Left            =   6135
      TabIndex        =   3
      Top             =   1305
      Width           =   1125
      _Version        =   65536
      _ExtentX        =   1984
      _ExtentY        =   635
      _StockProps     =   78
      Caption         =   "取消(&C)"
      BevelWidth      =   1
      Font3D          =   3
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "密码:"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Left            =   5190
      TabIndex        =   6
      Top             =   900
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "操作员:"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Left            =   5025
      TabIndex        =   5
      Top             =   540
      Width           =   720
   End
End
Attribute VB_Name = "frmSplash"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
Dim LOGINNO As Integer
Dim PassYu(30) As String
Private Declare Function SetActiveWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    '检查密码的正确性
 On Error GoTo Err_Display
Dim X As Long
    X = UserTxt.ListIndex
    '如果有加密,解密方法放此处,将PassYu(X)数组中的值,
    '转换成原来信息
  Dim FindStr As String
'将加密口令变回来
     Dim shiftStr As String, shiftStrR As Variant, shiftNum As Integer, ili As Integer, SureStr As String
      shiftStr = Trim(txtPassword.Text)
      shiftNum = Len(shiftStr)
      ili = 1
      SureStr = ""
        For ili = 1 To shiftNum
            shiftStrR = Mid(shiftStr, ili, 1)
            shiftStrR = Asc(shiftStrR)
            shiftStrR = shiftStrR - 3
            shiftStrR = Chr(shiftStrR)
            SureStr = SureStr & shiftStrR
        Next
        '密匙
   '开始查找 sureStr为解除的口令
    If SureStr = PassYu(X) Then
        UserText = UserTxt.Text
        '密码正确时
        Me.Hide
        frmSplash.MousePointer = 11
        '正常登录时
        Load frmMain
        ' AuthorityE  '设定权限
        frmMain.Show
        Exit Sub
    Else
        MsgBox "无效的密码,再试一次!", 32, "登录"
        LOGINNO = LOGINNO + 1
    If LOGINNO > 3 Then
        MsgBox "对不起,您不能使用该系统!", vbCritical, "登录失败"
        '不能登录时
        Unload Me
        Exit Sub
     End If
        txtPassword.SetFocus
        SendKeys "{Home}+{End}"
    End If
    
    Exit Sub

Err_Display:

  MsgBox "应用程序错误:" & vbCrLf & vbCrLf & Err.Description, "提示:By Yusilong."
  Exit Sub
End Sub

Private Sub Form_Load()

  GetFormSet Me, Screen
    '安装公司图片
  On Error Resume Next
  
  frmSplash.Picture = LoadPicture(App.Path & "\Setup.Bmp")

Dim retValue As Long
    retValue = SetActiveWindow(Me.hwnd)
     
Dim DB As Database, EF As Recordset, X As Long, i As Long
Dim UserYu(30) As String
  Set DB = OpenDatabase(ConData, False, False, Constr)
    Set EF = DB.OpenRecordset("Main", dbOpenTable)
        X = EF.RecordCount
    Set EF = DB.OpenRecordset("Select 操作员,口令 From MAIN", dbOpenDynaset)
    For i = 0 To X - 1
        UserYu(i) = EF.Fields(0).Value
        If Not IsNull(EF.Fields(1).Value) Then
           PassYu(i) = EF.Fields(1).Value
        End If
        UserTxt.AddItem UserYu(i), i
        EF.MoveNext
    Next
     EF.Close
     DB.Close
If X >= 1 Then
    UserTxt.ListIndex = 0
End If
    LOGINNO = 1
    
    '退出
    Exit Sub
NetErr:
    MsgBox " 未知错误,请重新登录!     ", vbInformation
    UserTxt.Enabled = False
    txtPassword.Enabled = False
    cmdOK.Enabled = False
    
    Exit Sub
End Sub

Private Sub Form_Unload(Cancel As Integer)
    
   SaveFormSet Me
    
End Sub

Private Sub txtPassword_Change()

 '   UserText = CheckProduct("Main", "口令", ConVertEncry(Trim(txtPassword.Text)), 0)
     
' If UserText <> "" Then
'    Me.Hide
'    Load frmMain
'    frmMain.Show
' End If
   
End Sub

Private Sub txtPassword_KeyPress(KeyAscii As Integer)

  If KeyAscii = 13 Then
     If Trim(txtPassword.Text) <> "" And Trim(UserTxt.Text) <> "" Then
        cmdOK.Value = True
     End If
  End If
  
End Sub

Private Sub UserTxt_Click()

 SendKeys "{Tab}"
 
End Sub

Private Sub UserTxt_KeyPress(KeyAscii As Integer)

  If KeyAscii = 13 Then
     txtPassword.SetFocus
  End If
  
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -