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

📄 frmpsw.frm

📁 VB人事管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmPsw 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "密码"
   ClientHeight    =   1905
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5100
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   1905
   ScaleWidth      =   5100
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton CmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   3840
      TabIndex        =   5
      Top             =   1200
      Width           =   975
   End
   Begin VB.CommandButton CmdOK 
      Caption         =   "确认"
      Height          =   375
      Left            =   3840
      TabIndex        =   4
      Top             =   720
      Width           =   975
   End
   Begin VB.TextBox TxtNew2 
      Height          =   285
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   10
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1320
      Width           =   1575
   End
   Begin VB.TextBox TxtNew1 
      Height          =   285
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   10
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   960
      Width           =   1575
   End
   Begin VB.TextBox Txtold 
      Height          =   285
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   10
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   600
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Height          =   1455
      Left            =   120
      TabIndex        =   6
      Top             =   360
      Width           =   3375
      Begin VB.Label Label4 
         Caption         =   "请再输入一次:"
         Height          =   375
         Left            =   240
         TabIndex        =   10
         Top             =   960
         Width           =   1455
      End
      Begin VB.Label Label3 
         Caption         =   "请输入新密码:"
         Height          =   255
         Left            =   240
         TabIndex        =   9
         Top             =   600
         Width           =   1335
      End
      Begin VB.Label Label2 
         Caption         =   "请输入原密码:"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   240
         Width           =   1335
      End
   End
   Begin VB.Frame Frame2 
      Height          =   1455
      Left            =   3720
      TabIndex        =   7
      Top             =   360
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "注意:普通用户只能修改本人自己的密码"
      Height          =   255
      Left            =   840
      TabIndex        =   0
      Top             =   120
      Width           =   3375
   End
End
Attribute VB_Name = "FrmPsw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const MxUser = 100
Dim user(MxUser), pws(MxUser), state(MxUser), Emplo(MxUser) As String

Private Sub CmdCancel_Click()

    Me.Hide
    If FrmMain.Pwin = "Frmmain" Then
            FrmMain.Enabled = True
            FrmMain.SetFocus
    Else
            Call FrmSys.ActiveAll
            FrmSys.SetFocus
    End If
    
End Sub

Private Sub cmdOK_Click()
    Dim fil, i, Usercount As Integer

    If TxtNew1.Text <> TxtNew2.Text Then
    
        MsgBox "two times no yizhi"
        TxtNew1.SetFocus
        TxtNew2.Text = ""
        SendKeys "{Home}+{End}"
        Exit Sub
    
    ElseIf Txtold.Text <> frmLogin.CurPsw Then
    
        MsgBox "old password wrong"
        Txtold.SetFocus
        TxtNew1.Text = ""
        TxtNew2.Text = ""
        SendKeys "{Home}+{End}"
        Exit Sub
 
    Else
                
        fil = FreeFile()
        Open App.Path + "\user.ini" For Input As #fil
           
           i = 0
        
           Do While Not EOF(fil)
              Input #fil, user(i), pws(i)
              Input #fil, state(i), Emplo(i)
                       
              i = i + 1
           Loop
            
             Usercount = i
                           
          Close #fil
         
        pws(frmLogin.CurId) = TxtNew1.Text
        frmLogin.CurPsw = TxtNew1.Text
    
        fil = FreeFile()
        Open App.Path + "\user.ini" For Output As #fil
    
        For i = 0 To Usercount - 1
             Print #fil, user(i); ","; pws(i); ","; state(i); ","; Emplo(i)
              
        Next i
             Close #fil
     
        Txtold.Text = ""
        TxtNew1.Text = ""
        TxtNew2.Text = ""
    
        Me.Hide
        If FrmMain.Pwin = "Frmmain" Then
            FrmMain.Enabled = True
            FrmMain.SetFocus
        Else
            Call FrmSys.ActiveAll
            FrmSys.SetFocus
        End If
           
    End If

         
End Sub

Private Sub Form_LostFocus()
    
    FrmPsw.SetFocus
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    'FrmMain.Enabled = True
    'FrmMain.SetFocus
    Unload Me
   
End Sub

⌨️ 快捷键说明

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