VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4425
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7245
   LinkTopic       =   "Form1"
   ScaleHeight     =   4425
   ScaleWidth      =   7245
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   2520
      Top             =   0
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin MSComctlLib.ProgressBar ProgressBar1 
      Height          =   375
      Left            =   2280
      TabIndex        =   7
      Top             =   3720
      Width           =   4815
      _ExtentX        =   8493
      _ExtentY        =   661
      _Version        =   393216
      Appearance      =   1
   End
   Begin VB.CommandButton Command1 
      Caption         =   "加密并存盘"
      Height          =   375
      Left            =   5640
      TabIndex        =   6
      Top             =   120
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   2895
      Left            =   4800
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   5
      Text            =   "v6j09-03.frx":0000
      Top             =   600
      Width           =   2295
   End
   Begin VB.TextBox Text1 
      Height          =   2895
      Left            =   2280
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   4
      Text            =   "v6j09-03.frx":0006
      Top             =   600
      Width           =   2175
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   120
      TabIndex        =   3
      Text            =   "Combo1"
      Top             =   3840
      Width           =   1935
   End
   Begin VB.FileListBox File1 
      Height          =   1530
      Left            =   120
      TabIndex        =   2
      Top             =   2160
      Width           =   1935
   End
   Begin VB.DirListBox Dir1 
      Height          =   1350
      Left            =   120
      TabIndex        =   1
      Top             =   600
      Width           =   1935
   End
   Begin VB.DriveListBox Drive1 
      Height          =   300
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1935
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
    File1.Pattern = Combo1.Text
End Sub

Private Sub Command1_Click()
    Dim strInput$, Code$, Record$, c As String * 1
    Dim i%, length%, iAsc%
    strInput = Text1.Text
    length = Len(RTrim(strInput))     '去掉字符串右边的空格,求真正的长度
    Code = ""
    For i = 1 To length
      c = Mid$(strInput, i, 1)        '取第i个字符
      Select Case c
        Case "A" To "Z"               '大写字母加序数5加密
          iAsc = Asc(c) + 5
          If iAsc > Asc("Z") Then iAsc = iAsc - 26   '加密后字母超过Z
          Code = Code + Chr$(iAsc)
        Case "a" To "z"
          iAsc = Asc(c) + 5           '小写字母加序数5加密
          If iAsc > Asc("z") Then iAsc = iAsc - 26
          Code = Code + Chr$(iAsc)
        Case Else                      '当第i个字符为其它字符时不加密,与加密字符串的前i-1个字符连接
          Code = Code + c
      End Select
    Next i
    Text2.Text = Code                '显示加密后的字符串
    CommonDialog1.Action = 2
    Open CommonDialog1.FileName For Output As #1
    For i = 1 To Len(Text1.Text)
        Print #1, Mid(Text1.Text, i, 1);
    Next i
    Close #1
End Sub

Private Sub Dir1_Change()
    File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_DblClick()
Dim inputdata As String * 1
    tfilename = IIf(Right(File1.Path, 1) = "\", File1.Path + File1.FileName, File1.Path + "\" + File1.FileName)
    Open tfilename For Input As #1
    Text1.Text = ""
    With ProgressBar1
        .Min = 0
        .Max = LOF(1)
        .Visible = True
        .Value = 0
    End With
    Do While Not EOF(1)
        inputdata = Input(1, #1)
        Text1.Text = Text1.Text + inputdata
        ProgressBar1.Value = ProgressBar1.Value + 1
    Loop
    ProgressBar1.Value = 0
    Close #1
End Sub

Private Sub Form_Load()
    Combo1.AddItem "*.txt"
    Combo1.AddItem "*.dat"
    Combo1.AddItem "*.*"
    Combo1.Text = "*.txt"
    File1.Pattern = "*.txt"
End Sub
