这段代码的涵义
Private Sub mnuEncryptBinary_Click()Dim EncStr As String
Dim EncKey As String, TempEncKey As String
Dim EncLen As Integer
Dim EncPos As Integer
Dim EncKeyPos As Integer
Dim tempChar As String
Dim TA As Integer, TB As Integer, TC As Integer
UndoText(frm) = ChildForms(frm).Text1.Text
JustChanged = True
TempEncKey = InputBox("Enter the encryption key. This key will be vital for decrypting this text later.", "Encrypt")
If TempEncKey = "" Then Exit Sub
EncStr = ""
EncPos = 1
EncKeyPos = 1
For x = 1 To Len(TempEncKey)
EncKey = EncKey & Asc(Mid$(TempEncKey, x, 1))
Next
EncLen = Len(EncKey)
For x = 1 To Len(ChildForms(frm).Text1.Text)
TB = Asc(Mid$(EncKey, EncKeyPos, 1))
EncKeyPos = EncKeyPos + 1
If EncKeyPos > EncLen Then EncKeyPos = 1
TA = Asc(Mid$(ChildForms(frm).Text1.Text, x, 1))
TC = TB Xor TA
tempChar = GetBinary(TC)
EncStr = EncStr & tempChar
Next
ChildForms(frm).Text1.Text = EncStr
End Sub
Private Sub mnuDecryptBinary_Click()
Dim EncStr As String
Dim EncKey As String, TempEncKey As String
Dim EncLen As Integer
Dim EncPos As Integer
Dim EncKeyPos As Integer
Dim tempChar As String
Dim TA As Integer, TB As Integer, TC As Integer
UndoText(frm) = ChildForms(frm).Text1.Text
JustChanged = True
TempEncKey = InputBox("Enter the decryption key. This is the key that was typed for encryption.", "Decrypt")
If TempEncKey = "" Then Exit Sub
EncStr = ""
EncPos = 1
EncKeyPos = 1
For x = 1 To Len(TempEncKey)
EncKey = EncKey & Asc(Mid$(TempEncKey, x, 1))
Next
EncLen = Len(EncKey)
For x = 1 To Len(ChildForms(frm).Text1.Text) Step 8
TB = Asc(Mid$(EncKey, EncKeyPos, 1))
EncKeyPos = EncKeyPos + 1
If EncKeyPos > EncLen Then EncKeyPos = 1
tempChar = Mid$(ChildForms(frm).Text1.Text, x, 8)
TA = BintoDec(tempChar)
TC = TB Xor TA
EncStr = EncStr & Chr$(TC)
Next
ChildForms(frm).Text1.Text = EncStr
End Sub
研究了很长时间,不知道有没有哪位可以加一下注释或者解释一下数据流程