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

📄 frmlogin1.frm

📁 引用枕善居的天宏钢构仓库管理系统 Ver 2.96
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin1 
   BackColor       =   &H00C0E0FF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "界面锁定管理"
   ClientHeight    =   2895
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   5160
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "frmLogin1.frx":0000
   ScaleHeight     =   1710.461
   ScaleMode       =   0  'User
   ScaleWidth      =   4844.961
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   320
      Left            =   3615
      TabIndex        =   6
      Top             =   2460
      Width           =   875
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   320
      Left            =   2325
      TabIndex        =   5
      Top             =   2460
      Width           =   875
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Height          =   300
      Left            =   1320
      TabIndex        =   3
      Top             =   2010
      Width           =   1290
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   3630
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   2010
      Width           =   1275
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   120
      Top             =   3090
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   1
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmLogin1.frx":1D1CE
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   1725
      Left            =   165
      TabIndex        =   4
      Top             =   120
      Width           =   4755
      _ExtentX        =   8387
      _ExtentY        =   3043
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   0
      NumItems        =   0
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   1005
      Top             =   3015
      Width           =   2175
      _ExtentX        =   3836
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label lblLabels 
      Alignment       =   1  'Right Justify
      BackColor       =   &H0080FC80&
      BackStyle       =   0  'Transparent
      Caption         =   "用户名称(&U):"
      Height          =   270
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   2040
      Width           =   1080
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H0000FF00&
      BackStyle       =   0  'Transparent
      Caption         =   "密码(&P):"
      Height          =   270
      Index           =   1
      Left            =   2760
      TabIndex        =   1
      Top             =   2040
      Width           =   1080
   End
End
Attribute VB_Name = "frmLogin1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2008/05/11
'描    述:天宏钢构仓库管理系统 Ver 2.96
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************

Dim itmX As ListItem     '定义一个ListItem对象
Dim key  As String       '定义字符串变量
'*** 用户登录按钮的事件代码 ***
Private Sub Command1_Click()
On Error Resume Next
Dim MPassword As String

 Adodc1.RecordSource = "select * from 用户管理 where 用户名='" & Text2.Text & "'"
 Adodc1.Refresh
      If Adodc1.Recordset.RecordCount > 0 Then
          MPassword = Adodc1.Recordset.Fields("用户密码")
          If Text1.Text = MPassword Then                     '判断数据的密码是否正确
              fMainForm.Enabled = True

                    '添加登录日志
                         fMainForm.WriteLog ("从界面管理重新登陆")
'以下三个变量保存以备后用
            UserName = Text2.Text '用户名
            UserPas = Text1.Text '密码
            Purview = Adodc1.Recordset.Fields("用户权限").Value '权限
               
               Unload Me
          Else
              MsgBox "密码不正确,请您确认后重新输入", , "界面管理登陆"
              Text1.Text = ""
              Text1.SetFocus
          End If
      Else
          MsgBox "对不起 没有此用户的信息", , "界面管理登陆"
          Text2.Text = ""
          Text1.Text = ""
      End If
  
End Sub

Private Sub Command2_Click()
   End
End Sub

Private Sub Form_Activate()
Dim R As Integer
MyMenu = GetSystemMenu(Me.hwnd, 0)
RemoveMenu MyMenu, &HF060, R
End Sub

Private Sub Form_Load()
On Error Resume Next
'Call WHScreen
'使用代码连接数据库与数据表
Adodc1.ConnectionString = DataConnectString
Adodc1.RecordSource = "select * from 用户管理"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
     ListView1.Enabled = True
     ListView1.ListItems.Clear
     Adodc1.Recordset.MoveFirst
     Do While Adodc1.Recordset.EOF = False                   '将操作员信息添加到ListView控件当中
        key = Adodc1.Recordset.Fields("用户名")
        Set itmX = ListView1.ListItems.Add(, , key, 1)
        Adodc1.Recordset.MoveNext
     Loop
Else
ListView1.Enabled = False
End If
 
End Sub

Private Sub ListView1_Click()
     On Error Resume Next
   Text2.Text = ListView1.SelectedItem
        Text1.SetFocus
  End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
   Call Command1_Click
End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text1.SetFocus
End If
End Sub

⌨️ 快捷键说明

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