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

📄 form1.frm

📁 VB 代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2700
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7380
   LinkTopic       =   "Form1"
   ScaleHeight     =   2700
   ScaleWidth      =   7380
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text3 
      Height          =   495
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   3
      Top             =   1320
      Width           =   7095
   End
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   2
      Top             =   720
      Width           =   7095
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   120
      Width           =   7095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   600
      TabIndex        =   0
      Top             =   2040
      Width           =   1815
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private chrOriginal(1 To 7) As Byte
Private chrCoded(1 To 8) As Byte
Private chrDecode(1 To 7) As Byte
Private Sub Command1_Click()
Dim strTemp As String
Dim lngLen As Long
    
    strTemp = "abcdefg"
    For i = 1 To 7
        chrOriginal(i) = Asc(Mid(strTemp, 8 - i, 1))
    Next i
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    For i = 1 To 7
        Text1.Text = Chr(chrOriginal(i)) + Text1.Text
    Next i
    Text1.Text = Text1.Text + Chr(13) + Chr(10)
    For i = 7 To 1 Step -1
        Text1.Text = Text1.Text + Hex((chrOriginal(i) And &HF0) / &H10) + Hex(chrOriginal(i) And &HF) + " "
    Next i

    
    Call s_Code
    For i = 1 To 8
        Text2.Text = Chr(chrCoded(i)) + Text2.Text
    Next i
    Text2.Text = Text2.Text + Chr(13) + Chr(10)
    For i = 8 To 1 Step -1
        Text2.Text = Text2.Text + Hex((chrCoded(i) And &HF0) / &H10) + Hex(chrCoded(i) And &HF) + " "
    Next i
    
    Call s_Decode
    For i = 1 To 7
        Text3.Text = Chr(chrDecode(i)) + Text3.Text
    Next i
    Text3.Text = Text3.Text + Chr(13) + Chr(10)
    For i = 7 To 1 Step -1
        Text3.Text = Text3.Text + Hex((chrDecode(i) And &HF0) / &H10) + Hex(chrDecode(i) And &HF) + " "
    Next i

End Sub

Private Sub s_Code()
    chrCoded(1) = chrOriginal(1) And &H7F
    chrCoded(2) = (chrOriginal(2) And &H3F) * &H2 Or (chrOriginal(1) And &H80) / &H80
    chrCoded(3) = (chrOriginal(3) And &H1F) * &H4 Or (chrOriginal(2) And &HC0) / &H40
    chrCoded(4) = (chrOriginal(4) And &HF) * &H8 Or (chrOriginal(3) And &HE0) / &H20
    chrCoded(5) = (chrOriginal(5) And &H7) * &H10 Or (chrOriginal(4) And &HF0) / &H10
    chrCoded(6) = (chrOriginal(6) And &H3) * &H20 Or (chrOriginal(5) And &HF8) / &H8
    chrCoded(7) = (chrOriginal(7) And &H1) * &H40 Or (chrOriginal(6) And &HFC) / &H4
    'chrCoded(8) = (chrOriginal(7) And &HFE) / &H2 Or &H80
    chrCoded(8) = (chrOriginal(7) And &HFE) / &H2
End Sub
Private Sub s_Decode()
    chrDecode(1) = (chrCoded(2) And &H1) * &H80 Or (chrCoded(1) And &H7F)
    chrDecode(2) = (chrCoded(3) And &H3) * &H40 Or (chrCoded(2) And &H7E) / &H2
    chrDecode(3) = (chrCoded(4) And &H7) * &H20 Or (chrCoded(3) And &H7C) / &H4
    chrDecode(4) = (chrCoded(5) And &HF) * &H10 Or (chrCoded(4) And &H78) / &H8
    chrDecode(5) = (chrCoded(6) And &H1F) * &H8 Or (chrCoded(5) And &H70) / &H10
    chrDecode(6) = (chrCoded(7) And &H3F) * &H4 Or (chrCoded(6) And &H60) / &H20
    chrDecode(7) = (chrCoded(8) And &H7F) * &H2 Or (chrCoded(7) And &H40) / &H40
End Sub

⌨️ 快捷键说明

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