Private Sub Command1_Click()
Dim FileTmp() As Byte, LF As Long, PassKey As Byte
Open "e:\1.txt" For Binary As #1
LF = LOF(1)
If LF > 0 Then
ReDim FileTmp(LF - 1)
Else
MsgBox "文件没有内容"
Exit Sub
End If
Get #1, , FileTmp
PassKey = 178
Call StrNormal(FileTmp, PassKey)
Put #1, 1, FileTmp
Close #1
End Sub
Private Sub StrNormal(ByRef FileTmp() As Byte, ByVal PassKey As Byte)
Dim i As Long, LF As Long
LF = UBound(FileTmp)
For i = 0 To LF
FileTmp(i) = FileTmp(i) Xor PassKey
Next
End Sub