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

📄 edcode.frm

📁 加密中文字符的例子
💻 FRM
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form EDcode 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Encrypt Decrypt Ver 1.0"
   ClientHeight    =   5475
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   10575
   Icon            =   "EDcode.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5475
   ScaleWidth      =   10575
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   1.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   75
      TabIndex        =   6
      Top             =   4530
      Width           =   10410
      Begin VB.TextBox Text1 
         BackColor       =   &H8000000F&
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         IMEMode         =   3  'DISABLE
         Left            =   4215
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   270
         Width           =   5970
      End
      Begin VB.CommandButton Command2 
         Caption         =   "解密"
         Height          =   630
         Left            =   2775
         TabIndex        =   5
         Top             =   120
         Width           =   1170
      End
      Begin VB.CommandButton Command1 
         Caption         =   "加密"
         Height          =   630
         Left            =   1350
         TabIndex        =   4
         Top             =   120
         Width           =   1170
      End
      Begin VB.OptionButton Option2 
         Caption         =   "高级模式"
         Height          =   285
         Left            =   120
         TabIndex        =   3
         Top             =   480
         Width           =   1080
      End
      Begin VB.OptionButton Option1 
         Caption         =   "普通模式"
         Height          =   285
         Left            =   120
         TabIndex        =   2
         Top             =   150
         Width           =   1080
      End
   End
   Begin RichTextLib.RichTextBox RichTextBox1 
      Height          =   4365
      Left            =   75
      TabIndex        =   0
      Top             =   90
      Width           =   10410
      _ExtentX        =   18362
      _ExtentY        =   7699
      _Version        =   393217
      BorderStyle     =   0
      ScrollBars      =   2
      DisableNoScroll =   -1  'True
      TextRTF         =   $"EDcode.frx":4DF2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "EDcode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
Option1.Value = True
Option2.Value = False
End Sub

Private Sub Option1_Click()
Text1.Enabled = False
Text1.BackColor = &H8000000F
Text1.Text = ""
End Sub

Private Sub Option2_Click()
Text1.Enabled = True
Text1.BackColor = &H80000005
Text1.Text = ""
End Sub

Private Sub Command1_Click()  '加密
On Error Resume Next
Dim Rtx

If Len(Trim$(RichTextBox1.Text)) <> 0 Then

   If Option1.Value = True And Option2.Value = False Then
      '普通模式
      Rtx = Crypt_A(RichTextBox1.Text)
      RichTextBox1.Text = Rtx
      Exit Sub
   Else
      '高级模式
      If Len(Trim$(Text1.Text)) = 0 Then
         MsgBox "密码不能为空", , "提示"
         Exit Sub
      Else
         Rtx = Crypt(Crypt_A(RichTextBox1.Text), Trim$(Text1.Text))
         RichTextBox1.Text = Rtx
         Exit Sub
      End If
   End If

End If

End Sub

Private Sub Command2_Click()  '解密
On Error Resume Next
Dim rtD

If Len(Trim$(RichTextBox1.Text)) <> 0 Then

   If Option1.Value = True And Option2.Value = False Then
      '普通模式
      rtD = DeCrypt_A(RichTextBox1.Text)
      RichTextBox1.Text = rtD
      Exit Sub
   Else
      '高级模式
      If Len(Trim$(Text1.Text)) = 0 Then
         MsgBox "密码不能为空", , "提示"
         Exit Sub
      Else
         rtD = DeCrypt_A(DeCrypt(RichTextBox1.Text, Trim$(Text1.Text)))
        RichTextBox1.Text = rtD
        Exit Sub
      End If
   End If

End If

End Sub

⌨️ 快捷键说明

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