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

📄 form1.frm

📁 文件加密的一个算法
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "RC4 Encryption Module 海阔天空收集整理 http://www.play78.com"
   ClientHeight    =   1785
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6600
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1785
   ScaleWidth      =   6600
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text3 
      Height          =   285
      Left            =   960
      TabIndex        =   6
      Text            =   "2.txt"
      Top             =   390
      Width           =   3375
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   960
      TabIndex        =   4
      Text            =   "1.txt"
      Top             =   30
      Width           =   3375
   End
   Begin VB.CommandButton Command1 
      Caption         =   "加密文件 / 解密文件"
      Default         =   -1  'True
      Height          =   555
      Left            =   2880
      TabIndex        =   3
      Top             =   810
      Width           =   2535
   End
   Begin VB.Frame Frame1 
      Caption         =   "密码"
      Height          =   615
      Left            =   300
      TabIndex        =   1
      Top             =   720
      Width           =   2205
      Begin VB.TextBox Text1 
         Height          =   285
         Left            =   240
         TabIndex        =   2
         Text            =   "Password"
         Top             =   210
         Width           =   1695
      End
   End
   Begin VB.Label Label4 
      Caption         =   "注意,把已经加密的文件再次加密即是解密"
      Height          =   585
      Left            =   4470
      TabIndex        =   8
      Top             =   30
      Width           =   1965
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "输出文件"
      Height          =   180
      Left            =   120
      TabIndex        =   7
      Top             =   390
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "文件"
      Height          =   180
      Left            =   150
      TabIndex        =   5
      Top             =   30
      Width           =   360
   End
   Begin VB.Label Label1 
      Caption         =   "海阔天空收集整理  http://www.play78.com/"
      Height          =   255
      Left            =   30
      TabIndex        =   0
      Top             =   1440
      Width           =   5505
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

' **********************************************************************
'  描  述:非常棒的加密解密函数,老外写的
'  Play78.com : 网站导航,源码之家,绝对开源
'  海阔天空收集整理
'  网址:http://www.play78.com/
'  QQ:13355575
'  e-mail:hglai@eyou.com
'  日期:2005年07月05日
' **********************************************************************

Option Explicit

Private Sub Command1_Click()
  Dim FileName As String
  Dim FileNum As Integer
  Dim FileBytes() As Byte

  'Open File Here
  'Veriable = "FileName"
  
  FileName = Text2
  
  'Reading File
  ReDim FileBytes(FileLen(FileName) - 1)
  FileNum = FreeFile
  Open FileName For Binary Access Read As FileNum
    Get #FileNum, , FileBytes
  Close FileNum

  'Encrypting/Decrypting Data
  RC4 FileBytes, Text1.Text 'Password

  'Save File Here Veriable = "FileName"
  FileName = Text3
  FileNum = FreeFile
  Open FileName For Binary Access Write As FileNum
    Put #FileNum, , FileBytes
  Close FileNum
End Sub

⌨️ 快捷键说明

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