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

📄 frmlogin.frm

📁 开发人力资源管理系统的目的就是帮助企业的人力资源部门提高工作效率,实现企业认识信息管理的系统化,规范化和自动化.根据这个系统所要实现的目的和任务,总结出这个系统最终实现的主要功能如下: 1.部门信息
💻 FRM
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form FrmLogin 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "身份验证"
   ClientHeight    =   2010
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3795
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   MouseIcon       =   "FrmLogin.frx":0000
   ScaleHeight     =   2010
   ScaleWidth      =   3795
   StartUpPosition =   2  '屏幕中心
   Begin MSWinsockLib.Winsock Client 
      Left            =   0
      Top             =   1320
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_Cancel 
      BackColor       =   &H80000000&
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   2117
      MouseIcon       =   "FrmLogin.frx":0CCA
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   1440
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Ok 
      BackColor       =   &H80000000&
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   317
      MouseIcon       =   "FrmLogin.frx":0FD4
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   1440
      Width           =   1300
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H80000000&
      Height          =   1215
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   3495
      Begin VB.TextBox txtPwd 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   1080
         MaxLength       =   20
         PasswordChar    =   "*"
         TabIndex        =   2
         ToolTipText     =   "输入密码,不超过20个字符"
         Top             =   795
         Width           =   2175
      End
      Begin VB.TextBox txtUser 
         Height          =   270
         Left            =   1080
         MaxLength       =   20
         TabIndex        =   1
         ToolTipText     =   "输入用户名,不超过20个字符"
         Top             =   315
         Width           =   2175
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "用户名"
         Height          =   180
         Left            =   240
         TabIndex        =   4
         Top             =   360
         Width           =   540
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "密 码"
         Height          =   180
         Left            =   240
         TabIndex        =   3
         Top             =   840
         Width           =   540
      End
   End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Public PasswordKey As String
Public NameKey As String
Public Try_times As Integer

Private Sub Client_Close()
  connected = False
End Sub

Private Sub Client_Connect()
  connected = True
End Sub

Private Sub Client_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  connected = False
  MsgBox "服务器没有相应"
  DBapi_Disconnect
'  myhost.setfree
  End
End Sub

Private Sub Cmd_Cancel_Click()
  End
End Sub

Private Sub Cmd_OK_Click()
  Dim j As Single

'数据有效性检查
  If txtUser = "" Then
    MsgBox "请输入用户名"
    txtUser.SetFocus
    Exit Sub
  End If
  If txtPwd = "" Then
    MsgBox "请输入密码"
    txtPwd.SetFocus
    Exit Sub
  End If
 
  NameKey = MakeStr(txtUser)
  PasswordKey = MakeStr(txtPwd)
   
'判断用户是否存在
  If MyUser.In_DB(NameKey) = False Then
    MsgBox "用户名不存在"
    Try_times = Try_times + 1
    If Try_times >= 3 Then
      MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
      DBapi_Disconnect
      End
    Else
      Exit Sub
    End If
  End If

'判断密码是否正确
  MyUser.GetInfo (NameKey)
  If MyUser.Pwd <> PasswordKey Then
    MsgBox "密码错误"
    Try_times = Try_times + 1
    If Try_times >= 3 Then
      MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
      DBapi_Disconnect
      End
    Else
      Exit Sub
    End If
  End If
  
'登录成功,将当前用户的信息保存在CurUser中
  CurUser.UserName = MyUser.UserName
  CurUser.User_type = MyUser.User_type
  CurUser.Emp_Id = MyUser.Emp_Id
'关闭自己
  Unload Me
End Sub

Private Sub Form_Load()
  '初始化连接变量
  IsConnect = False
  Connect_Num = 0
  
  '读取服务器数据
  ServerName = GetKey(App.Path + "\Setup.ini", "Server Name")
  If ServerName = "" Then
    MsgBox "Setup.ini格式不正确,请重新设置"
    DBapi_Disconnect
    End
  End If
  
  connected = False
  Client.RemoteHost = ServerName
  Client.RemotePort = 4477
  Client.Connect
End Sub

⌨️ 快捷键说明

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