返回列表 上一主題 發帖

[發問] 從txt file讀出binary/hex data,結尾卻多出一個byte為0

回復 3# swatt


    Sub Temp1()
    Dim intFileNum%, byttemp As Byte, intCellRow%, pos
    intFileNum = FreeFile
    intCellRow = 0
   
    fipath = "C:\hello.txt"
   
    Open fipath For Binary Access Read As intFileNum
   
    Do While pos < LOF(intFileNum)
        intCellRow = intCellRow + 1
        Get intFileNum, , byttemp
        pos = Loc(intFileNum)
        Cells(1, intCellRow) = Hex(byttemp)
    Loop
   
    Close intFileNum

MsgBox "Done."

End Sub

TOP

        靜思自在 : 發脾氣是短暫的發瘋。
返回列表 上一主題