1

我有一个变量声明如下 -

Public CA() As Byte

当我想将其内容写入文件时,我执行以下操作 -

myStr = StrConv(CA, vbUnicode)        
intFileHandle = FreeFile
Open "myFile.txt" For Output As #intFileHandle
Print #intFileHandle, myStr
Close #intFileHandle

但是,我不确定这是否是正确的方法。您能否推荐一种将字节数组的内容写入文件的正确方法?

4

1 回答 1

4
fnum = FreeFile
Open "myFile.txt" For Binary As #fnum
Put #fnum, 1, CA
Close fnum
于 2012-05-23T22:31:48.467 回答