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

📄 frmdemo.frm

📁 基于U盘的软件授权组件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmDemo 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Demo (USBPass 2.0)"
   ClientHeight    =   5220
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9390
   Icon            =   "frmDemo.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5220
   ScaleWidth      =   9390
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton CmdClearUSB 
      Caption         =   "清除USBPass"
      Height          =   450
      Left            =   150
      TabIndex        =   20
      Top             =   2085
      Width           =   2175
   End
   Begin VB.CommandButton CmdChangePassWD 
      Caption         =   "修改USBPass密码"
      Height          =   450
      Left            =   150
      TabIndex        =   4
      Top             =   1590
      Width           =   2175
   End
   Begin VB.CommandButton CmdAbout 
      Caption         =   "关于USBPass组件"
      Height          =   450
      Left            =   150
      TabIndex        =   5
      Top             =   2580
      Width           =   2175
   End
   Begin VB.CommandButton CmdClear 
      Caption         =   "清除窗口数据"
      Height          =   450
      Left            =   150
      TabIndex        =   6
      Top             =   4035
      Width           =   2175
   End
   Begin VB.CommandButton CmdExit 
      Caption         =   "退出(&X)"
      Height          =   450
      Left            =   150
      TabIndex        =   0
      Top             =   4530
      Width           =   2175
   End
   Begin VB.Frame Frame1 
      Height          =   5085
      Left            =   2520
      TabIndex        =   7
      Top             =   30
      Width           =   6810
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   11
         Left            =   195
         TabIndex        =   19
         Top             =   4695
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   10
         Left            =   195
         TabIndex        =   18
         Top             =   4305
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   9
         Left            =   195
         TabIndex        =   17
         Top             =   3915
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   8
         Left            =   195
         TabIndex        =   16
         Top             =   3510
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   7
         Left            =   195
         TabIndex        =   15
         Top             =   3120
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   6
         Left            =   195
         TabIndex        =   14
         Top             =   2715
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   5
         Left            =   195
         TabIndex        =   13
         Top             =   2325
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   4
         Left            =   195
         TabIndex        =   12
         Top             =   1935
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   3
         Left            =   195
         TabIndex        =   11
         Top             =   1530
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   2
         Left            =   195
         TabIndex        =   10
         Top             =   1140
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   1
         Left            =   195
         TabIndex        =   9
         Top             =   735
         Width           =   90
      End
      Begin VB.Label LabInfo 
         AutoSize        =   -1  'True
         Caption         =   "*"
         Height          =   180
         Index           =   0
         Left            =   195
         TabIndex        =   8
         Top             =   345
         Width           =   90
      End
   End
   Begin VB.CommandButton CmdReadB 
      Caption         =   "读USBPass(不带密码)"
      Height          =   450
      Left            =   150
      TabIndex        =   3
      Top             =   1095
      Width           =   2175
   End
   Begin VB.CommandButton CmdReadA 
      Caption         =   "读USBPass(带密码)"
      Height          =   450
      Left            =   150
      TabIndex        =   2
      Top             =   600
      Width           =   2175
   End
   Begin VB.CommandButton CmdWrite 
      Caption         =   "写USBPass"
      Height          =   450
      Left            =   150
      TabIndex        =   1
      Top             =   105
      Width           =   2175
   End
End
Attribute VB_Name = "frmDemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************************
'**模 块 名:frmDemo
'**说    明:版权所有2008 - 2009(C)
'**创 建 人:
'**日    期:
'**描    述:USBPass组件的Demo
'**版    本:V1.0.0
'*************************************************************************
Option Explicit

Private USBPass As New uPassMain
Private USBPassR As New uPassRead

'*************************************************************************
'**函 数 名:CmdAbout_Click
'**输    入:无
'**输    出:无
'**全局变量:
'**调用模块:
'**作    者:
'**日    期:
'**功能描述:
'**版    本:V1.0.0
'*************************************************************************
Private Sub CmdAbout_Click()
    USBPass.PassAbout
End Sub

Private Sub CmdChangePassWD_Click()
    Dim strOldPassWD As String, strNewPassWD As String
    frmDialog.Caption = "请输入原来密码"
    frmDialog.Show 1
    strOldPassWD = frmDialog.TBack_PassWD
    If strOldPassWD = "" Then
        Unload frmDialog
        Exit Sub
    End If
    frmDialog.Caption = "请输入新密码"
    frmDialog.Show 1
    strNewPassWD = frmDialog.TBack_PassWD
    If strNewPassWD = "" Then
        Unload frmDialog
        Exit Sub
    End If
    Unload frmDialog
    Call USBPass.ChangePassWD(strOldPassWD, strNewPassWD)
    MsgBox USBPass.TBack_MsgStr, vbInformation, "信息"
End Sub

'*************************************************************************
'**函 数 名:CmdClear_Click
'**输    入:无
'**输    出:无
'**全局变量:
'**调用模块:
'**作    者:
'**日    期:
'**功能描述:清除窗口数据
'**版    本:V1.0.0
'*************************************************************************
Private Sub CmdClear_Click()
    Dim intI As Integer

    For intI = 0 To 11
        LabInfo(intI).Caption = "*"
    Next
    Me.Refresh
End Sub

Private Sub CmdClearUSB_Click()
    CmdClear_Click
    USBPass.PassClear
    MsgBox USBPass.TBack_MsgStr, vbInformation, "信息"
End Sub

Private Sub CmdExit_Click()
    Set USBPass = Nothing
    Unload Me
End Sub

'*************************************************************************
'**函 数 名:CmdReadA_Click
'**输    入:无
'**输    出:无
'**全局变量:
'**调用模块:
'**作    者:
'**日    期:
'**功能描述:带密码读授权
'**版    本:V1.0.0
'*************************************************************************
Private Sub CmdReadA_Click()
    Dim strR_PassWD As String

    frmDialog.Caption = "请输入密码"
    frmDialog.Show 1
    strR_PassWD = frmDialog.TBack_PassWD
    Unload frmDialog
    If Trim(strR_PassWD) = "" Then
        Exit Sub
    End If
    CmdClear_Click
    If USBPass.PassRead(strR_PassWD) Then
        Call SHowInfo
    End If
    MsgBox USBPass.TBack_MsgStr, vbInformation, "信息"
End Sub

'*************************************************************************
'**函 数 名:CmdReadB_Click
'**输    入:无
'**输    出:无
'**全局变量:
'**调用模块:
'**作    者:
'**日    期:
'**功能描述:不带密码读授权
'**版    本:V1.0.0
'*************************************************************************
Private Sub CmdReadB_Click()
    CmdClear_Click
    If USBPassR.PassRead Then
        Call ShowInfoR
    End If
    MsgBox USBPassR.TBack_MsgStr, vbInformation, "信息"
End Sub

'*************************************************************************
'**函 数 名:CmdWrite_Click
'**输    入:无
'**输    出:无
'**全局变量:
'**调用模块:
'**作    者:
'**日    期:
'**功能描述:写授权
'**版    本:V1.0.0
'*************************************************************************
Private Sub CmdWrite_Click()
    Dim strR_PassWD As String
    Load frmDialog
    frmDialog.Caption = "请输入密码"
    frmDialog.Show 1
    strR_PassWD = frmDialog.TBack_PassWD
    Unload frmDialog
    If strR_PassWD = "" Then Exit Sub
    If USBPass.PassCreate(strR_PassWD) Then
        Call SHowInfo
    End If
    MsgBox USBPass.TBack_MsgStr, vbInformation, "信息"
End Sub

'*************************************************************************
'**函 数 名:SHowInfo
'**输    入:无
'**输    出:(Boolean) -
'**全局变量:
'**调用模块:
'**作    者:
'**日    期:
'**功能描述:显示授权信息
'**版    本:V1.0.0
'*************************************************************************
Private Function SHowInfo() As Boolean
    LabInfo(0).Caption = "USB磁盘驱动器   :" & USBPass.TBack_DiskName
    LabInfo(1).Caption = "USBPass授权编号 :" & USBPass.TBack_DrvKeyNumber
    LabInfo(2).Caption = "授权写入时间    :" & USBPass.TBack_RegDate
    LabInfo(3).Caption = "授权软件代码    :" & USBPass.TBack_SoftCode
    LabInfo(4).Caption = "使用单位名称    :" & USBPass.TBack_UnitName
    LabInfo(5).Caption = "是否限制使用次数:" & USBPass.TBack_IsTime
    LabInfo(6).Caption = "剩余使用次数    :" & USBPass.TBack_UseTime
    LabInfo(7).Caption = "是否显示使用天数:" & USBPass.TBack_IsFate
    LabInfo(8).Caption = "剩余使用天数    :" & USBPass.TBack_UseFate
    LabInfo(9).Caption = "是否任意条件触发:" & USBPass.TBack_IsAll
    LabInfo(10).Caption = "最后使用日期    :" & USBPass.TBack_LastDate
    LabInfo(11).Caption = "附加信息        :" & USBPass.TBack_AnnexInfo
End Function
Private Function ShowInfoR() As Boolean
    LabInfo(0).Caption = "USB磁盘驱动器   :" & USBPassR.TBack_DiskName
    LabInfo(1).Caption = "USBPass授权编号 :" & USBPassR.TBack_DrvKeyNumber
    LabInfo(2).Caption = "授权写入时间    :" & USBPassR.TBack_RegDate
    LabInfo(3).Caption = "授权软件代码    :" & USBPassR.TBack_SoftCode
    LabInfo(4).Caption = "使用单位名称    :" & USBPassR.TBack_UnitName
    LabInfo(5).Caption = "是否限制使用次数:" & USBPassR.TBack_IsTime
    LabInfo(6).Caption = "剩余使用次数    :" & USBPassR.TBack_UseTime
    LabInfo(7).Caption = "是否显示使用天数:" & USBPassR.TBack_IsFate
    LabInfo(8).Caption = "剩余使用天数    :" & USBPassR.TBack_UseFate
    LabInfo(9).Caption = "是否任意条件触发:" & USBPassR.TBack_IsAll
    LabInfo(10).Caption = "最后使用日期    :" & USBPassR.TBack_LastDate
    LabInfo(11).Caption = "附加信息        :" & USBPassR.TBack_AnnexInfo
End Function

⌨️ 快捷键说明

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