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

📄 frm_login.frm

📁 考勤系统,智能判断刷卡异常,是一大型ERP系统的一个分支
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frm_Login 
   BackColor       =   &H00C0DCC0&
   Caption         =   "NewAsia考勤异常确认"
   ClientHeight    =   3990
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7095
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   3990
   ScaleWidth      =   7095
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   500
      Index           =   0
      Left            =   2400
      Picture         =   "Frm_Login.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   3240
      Width           =   735
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      Height          =   500
      Index           =   1
      Left            =   4080
      Picture         =   "Frm_Login.frx":00F2
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   3240
      Width           =   735
   End
   Begin VB.TextBox txtPassword 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   2865
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   2310
      Width           =   2325
   End
   Begin VB.TextBox txtUserName 
      Height          =   345
      Left            =   2865
      TabIndex        =   1
      Top             =   1920
      Width           =   2325
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0DCC0&
      Caption         =   "密码:"
      Height          =   270
      Index           =   1
      Left            =   1680
      TabIndex        =   5
      Top             =   2325
      Width           =   1080
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0DCC0&
      Caption         =   "用户工号:"
      Height          =   270
      Index           =   0
      Left            =   1680
      TabIndex        =   4
      Top             =   1935
      Width           =   1080
   End
   Begin VB.Label Label2 
      BackColor       =   &H00C0DCC0&
      Caption         =   "NewAsia考勤异常确认"
      BeginProperty Font 
         Name            =   "华文彩云"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800000&
      Height          =   735
      Left            =   840
      TabIndex        =   0
      Top             =   600
      Width           =   5415
   End
End
Attribute VB_Name = "Frm_Login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim mDB As mDB

Dim strSQL As String
Private adoprimaryRS As ADODB.Recordset
Private strSQL2 As String
Private adoPrimaryRS2 As ADODB.Recordset


Private Sub Command1_Click(Index As Integer)
Static i As Integer

Select Case Index
Case 0
If txtUserName.Text = "" Then End

    
'On Error Resume Next
If txtUserName.Text = "" And txtPassword.Text = "" Then
Unload Me
End If


If adoPrimaryRS2.Fields("oper_pass").Value = Encypt.Decode_Pass(txtPassword.Text) Then

emplyid = adoPrimaryRS2.Fields("emplyid").Value
OperID = emplyid

UserName = adoPrimaryRS2.Fields("oper_name").Value

InsertDengLeLog OperID, UserName, "KaoQinQR"             '''App.Title

Frm_Rpt_KaoQinYC.Show

Unload Me

Else
i = i + 1
If i > 3 Then End

        MsgBox "无效的密码,请重试!", , "登录"
        txtPassword.SetFocus
        SendKeys "{Home}+{End}"
        

End If
    
Case 1
    
    Unload Me
    End
End Select
End Sub

Private Sub Form_Load()
Dim sConn As String
    Dim sServer As String
    Dim sDatasourceName As String
    Dim sUser As String

    'On Error Resume Next
    On Error GoTo Err1

    Dim o As New iniFunc
    sServer = o.sGetINI(App.Path & "\SQLnewasia.ini", "setting", "Server Name", "zjxy")
    sDatasourceName = o.sGetINI(App.Path & "\SQLnewasia.ini", "setting", "DATABASE NAME", "xinya")
    sUser = o.sGetINI(App.Path & "\SQLnewasia.ini", "setting", "User Name", "reformer")
    Set o = Nothing

    sConn = "Provider=SQLOLEDB.2;Persist Security Info=True;SERVER=" & sServer & ";User ID=" & sUser & ";Password=5148936;DataBase=" & sDatasourceName

Set mDB = New mDB
mDB.InitDB_RY sConn


strSQL2 = "select * from hOperator"
Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)


    Exit Sub

Err1:
    MsgBox sServer & ";" & sDatasourceName & ";" & sUser & ";不正确。"


End Sub

Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0
SendKeys vbTab
End If


End Sub

Private Sub txtUserName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0
SendKeys vbTab
End If

End Sub


Private Sub txtUserName_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
KeyAscii = vbKeyTab
End If

End Sub


Private Sub txtUserName_LostFocus()
Dim i As Integer
If txtUserName.Text = "" Then Exit Sub

''   strSQL = "select * from operater where operid='" & txtUserName.Text & "'"
'   strSQL = "select * from hoper where oper_ID='" & txtUserName.Text & "'"
''Database_Refresh 0
'Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
'
'   If adoprimaryRS.RecordCount < 1 Then
'   If txtUserName.Text = "" Then
'   Call cmdOk_Click
'   End If
'
'        MsgBox "用户名错误!"
'        txtUserName.Text = ""
'        txtUserName.SetFocus
'    Else
'        txtPassword.SetFocus
'    End If
'
'If DataCombo1.Text <> "" Then
With adoPrimaryRS2
    .Find "emplyid='" & txtUserName.Text & "'", 0, adSearchForward, adBookmarkFirst
    If .EOF Then
    i = i + 1
    If i > 1 Then Exit Sub
    
    MsgBox "用户不存在。"
    txtUserName.SetFocus
    SendKeys "{home}+{end}"
    Exit Sub
    Else
    .Filter = "emplyid='" & txtUserName.Text & "'"
    
    '''''''新用户设置密码;
    If IsNull(.Fields("oper_pass").Value) Or .Fields("oper_pass").Value = "" Then
    MsgBox "你是第一次使用本系统的新用户,请先设置好的密码,请记好,别忘记了啊!"
    Dim tmpMM As String
    Dim tmpS1 As String
    Dim tmpS2 As String
    
    With sForm
        .MiMa_SZ
        tmpS1 = .GetFindVar1
        tmpS2 = .GetFindVar2
     End With
        If tmpS1 = tmpS2 And tmpS1 <> "" Then
        tmpMM = Encypt.Decode_Pass(tmpS1)
        .Fields("oper_pass").Value = tmpMM
        .Update
        Else
        Exit Sub
        
        End If
     ''''''''''''''\\\\\\\\\\\\\\\\\\\\\\\\\\\
     
    Else
    
'    If .Fields("oper_pass").Value = Encypt.UnCode_Pass(txtPassword.Text) Then
'    Else
'    MsgBox "密码无效。请再试一次。"
'    End If

    End If
    
    End If
End With
'End If



End Sub

⌨️ 快捷键说明

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