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

📄 frmlogin.frm

📁 一个称重计量程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frmlogin 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "登录到系统"
   ClientHeight    =   1860
   ClientLeft      =   2850
   ClientTop       =   3390
   ClientWidth     =   4455
   ControlBox      =   0   'False
   Icon            =   "Frmlogin.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1860
   ScaleWidth      =   4455
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox PWDtxt 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00000000&
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   1800
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   600
      Width           =   2295
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   375
      Left            =   240
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1320
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2880
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1320
      Width           =   1215
   End
   Begin VB.ComboBox sysCmb 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00000000&
      Height          =   300
      Left            =   1800
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   120
      Width           =   2295
   End
   Begin VB.CommandButton Command3 
      Caption         =   "注册"
      Height          =   375
      Left            =   1560
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1320
      Width           =   1215
   End
   Begin VB.Image Image2 
      Height          =   240
      Left            =   240
      Picture         =   "Frmlogin.frx":0442
      Stretch         =   -1  'True
      Top             =   720
      Width           =   360
   End
   Begin VB.Image Image1 
      Height          =   360
      Left            =   240
      Picture         =   "Frmlogin.frx":0884
      Stretch         =   -1  'True
      Top             =   120
      Width           =   360
   End
   Begin VB.Label Label1 
      BackColor       =   &H00C0C0C0&
      BackStyle       =   0  'Transparent
      Caption         =   "选择过磅员"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   840
      TabIndex        =   6
      Top             =   240
      Width           =   975
   End
   Begin VB.Label Label2 
      BackColor       =   &H00C0C0C0&
      BackStyle       =   0  'Transparent
      Caption         =   "输入密码"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   840
      TabIndex        =   5
      Top             =   720
      Width           =   1095
   End
End
Attribute VB_Name = "Frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rdsys As New ADODB.Recordset
Private Sub Command1_Click()
 If GetSetting("ljg", "llx", "xtzc") = 0 Then
   If (Date - CDate(GetSetting("ljg", "llx", "xtzcsj"))) > 60 Then
       MsgBox "该软件使用期已到,请注册,以确保您的无限制使用!", vbInformation + vbOKOnly, "提示!"
       Unload Me
     Exit Sub
    End If
    If GetSetting("ljg", "llx", "xtzctime") > 1000 Then
         MsgBox "该软件使用期已到,请注册,以确保您的无限制使用!", vbInformation + vbOKOnly, "提示!"
         Unload Me
         Exit Sub
    End If
  End If
 rdsys.Open "select*from tb_user where 过磅员='" & Trim(sysCmb.Text) & "'", Cn, adOpenKeyset, adLockOptimistic
    If rdsys.Fields!密码 = Trim(PWDtxt.Text) Then
     UserName = rdsys.Fields!过磅员
     If UserName <> "系统管理员" Then
        Mfrmmain.过磅员管理.Visible = False
        Mfrmmain.Toolbar1.Buttons(4).Visible = False
      End If
        Mfrmmain.Show
       frmmain.Show
       Unload Me
    Else
    MsgBox "密码输入错误,请重新输入!", vbExclamation + vbOKOnly, "信息提示"
    PWDtxt = ""
    PWDtxt.SetFocus
    End If
 rdsys.Close
End Sub

Private Sub Command2_Click()
 End
End Sub

Private Sub Command3_Click()
frmzc.Show 1
End Sub

Private Sub Form_Load()
If App.PrevInstance = True Then
  MsgBox "系统已经启动了,不能同时启动多个程序。", vbInformation + vbOKOnly, "提示!"
  Unload Me
  Exit Sub
End If
If GetSetting("ljg", "llx", "xtzc") = "" Then
   SaveSetting appname:="ljg", Section:="llx", Key:="xtzc", setting:=0
 End If
 If GetSetting("ljg", "llx", "xtzcsj") = "" Then
   SaveSetting appname:="ljg", Section:="llx", Key:="xtzcsj", setting:=Date
 End If
 If GetSetting("ljg", "llx", "xtzctime") = "" Then
   SaveSetting appname:="ljg", Section:="llx", Key:="xtzctime", setting:=0
 End If
   SaveSetting appname:="ljg", Section:="llx", Key:="xtzctime", setting:=GetSetting("ljg", "llx", "xtzctime") + 1
If GetSetting("ljg", "llx", "xtzc") = 1 Then
   Command3.Visible = False
 End If
'On Error GoTo aa
 Cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database\czgl.mdb;Persist Security Info=False;Jet OLEDB:Database Password=ljglzx"
 rdsys.Open "select*from tb_user order by 过磅员代号", Cn, adOpenDynamic, adLockOptimistic
    sysCmb.Clear
    Do Until rdsys.EOF
      sysCmb.AddItem Trim(rdsys.Fields!过磅员)
      rdsys.MoveNext
    Loop
    rdsys.Close
   sysCmb.ListIndex = 0
   Exit Sub
aa:
 MsgBox "数据库连接错误!"
 Unload Me
End Sub

⌨️ 快捷键说明

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