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

📄 frmmima.frm

📁 本系统是给大庆油田做的一个示例程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmMiMa 
   AutoRedraw      =   -1  'True
   Caption         =   "修改密码"
   ClientHeight    =   2385
   ClientLeft      =   3870
   ClientTop       =   3030
   ClientWidth     =   4545
   ControlBox      =   0   'False
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   2385
   ScaleWidth      =   4545
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Mima_Exit 
      Cancel          =   -1  'True
      Caption         =   "返  回"
      Height          =   315
      Left            =   2520
      TabIndex        =   3
      Top             =   1650
      Width           =   915
   End
   Begin VB.CommandButton Mima_Ok 
      Caption         =   "确  定"
      Default         =   -1  'True
      Height          =   315
      Left            =   1110
      TabIndex        =   2
      Top             =   1650
      Width           =   915
   End
   Begin VB.TextBox Mima_Txt 
      BackColor       =   &H00E0E0E0&
      Height          =   285
      IMEMode         =   3  'DISABLE
      Left            =   1695
      MaxLength       =   15
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   930
      Width           =   1695
   End
   Begin VB.Label Mima_tishi 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请输入原密码 !"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF00FF&
      Height          =   210
      Left            =   1350
      TabIndex        =   4
      Top             =   420
      Width           =   1605
   End
   Begin VB.Label Mima_Lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "原密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   210
      Left            =   630
      TabIndex        =   1
      Top             =   1005
      Width           =   840
   End
End
Attribute VB_Name = "FrmMiMa"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim PasswordOk As Boolean

Private Sub Form_Activate()
  PasswordOk = False
  Mima_Lbl.Caption = "原密码:"             '提示
  Mima_tishi.Caption = "请输入原密码!"    '提示
  Mimas = ""                               '清除密码(“*”号)
  Mima_Txt = ""
  Mima_Txt.SetFocus
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyEscape Then Unload Me 'Me.Hide
  If KeyCode = vbKeyF1 Then PopupMenu FrmMain.MenuH
End Sub

Private Sub Mima_Ok_Click()
  Dim K As Integer, ss As String, X, i As Integer, Mx(15) As Byte
  Mimas = Mima_Txt.Text
  If PasswordOk = False Then
    If Mimasave = "las" Then
        K = 0
    Else
        K = StrComp(Mimas, Mimasave) '输入密码与原密码比较
    End If
    
    If K = 0 Then                   '如果一致
      PasswordOk = True
      Mima_tishi.Caption = "请输入新原密 !"       '提示
      Mima_Lbl.Caption = "新密码:"             '提示
     Else                                          '如果不一致
      Mima_tishi.Caption = "原密码错,请重新输入 !" '提示
    End If
    Mimas = ""                                     '清除密码(“*”号)
    Mima_Txt = ""
    Mima_Txt.SetFocus
    Call Sound
  Else
    Mimasave = Mimas
    X = FreeFile
    ss = CurPath & "rodmima.dat"
    Kill ss
    Open ss For Binary Access Write As #X '打开(创建)密码文件
    For i = 0 To Len(Mimasave) - 1
      Mx(i) = Asc(Mid$(Mimasave, i + 1, 1))
      Mx(i) = Mx(i) + 100 + i * 3
      Put #X, , Mx(i)
    Next i
    Close #X
    
    Call Mima_Exit_Click
  End If
 
End Sub

Private Sub Mima_Exit_Click()
  Unload Me
End Sub

⌨️ 快捷键说明

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