高手,以下代码是对infile文件进行Base64解码,我想如infile是一个字符串,那么下面代码该如何改变,谢谢!!!Public Function Base64Decode(infile As String, Outfile As String)
Dim FnumIn As Integer, FnumOut As Integer
Dim mInByte(4) As Byte, mOutByte(3) As Byte
Dim myByte As Byte
Dim i As Integer, LineLen As Integer, j As Integer
Dim ByteNum As Integer
FnumIn = FreeFile()
Open infile For Binary As #FnumIn
FnumOut = FreeFile()
Open Outfile For Binary As #FnumOutWhile Not EOF(FnumIn)
i = 0
Do While i < 4
Get #FnumIn, , myByte
If Not EOF(FnumIn) Then
If myByte <> &HA And myByte <> &HD Then
'把回车符和换行符去掉
mInByte(i) = myByte
i = i + 1
End If
Else
Exit Do
End If
Loop
Base64DecodeByte mInByte, mOutByte, ByteNum
For j = 0 To 2 - ByteNum
Put #FnumOut, , mOutByte(j)
Next j
'LineLen = LineLen + 1
Wend
Close (FnumOut)
Close (FnumIn)
End Function
^^^^^^^^^^^^^^^^^