VBA字节数组
1 Sub readArrByte() 2 Dim strPath As String, ArByte() As Byte 3 Dim intFileLen As Integer 4 '配置路径、字节数组 5 strPath = ActivePresentation.Path ' 6 strPath = strPath & "\" & "ByteFile - 副本.txt" 7 intFileLen = FileLen(strPath) 8 ReDim ArByte(intFileLen) 9 '读入文件至字节数组 10 Open strPath For Binary As #1 11 Get #1, , ArByte ' Put #1, , arr 写入 12 Close #1 13 '转换字节数组 14 Dim str As String 15 str = StrConv(ArByte, vbFromUnicode) 16 Debug.Print str 17 End Sub