2007-10-25 22:53:13
Kenny
如何讀/寫 Binary File
原始來源: cww
'以下是讀取Binary file的程式
Dim Buff() as Byte
Open "d:\csys\8504\ctc" For Binary Access Read As #1
ReDim Buff(267)
Do While Not EOF(1)
Get #1, , Buff '每次讀268個byte進來
'Call 處理Buff 的Routine
Loop
Close #1
'以下是寫入Binary file的程式
Dim Buff() As Byte
Open "c:\tc" For Binary Access Write As #1
ReDim Buff(10)
Buff = StrConv("這是一個11", vbFromUnicode)
Put #1, , Buff
ReDim Buff(1)
Buff(0) = 210
Buff(1) = 70
Put #1, , Buff
Close #1
End Sub
上一篇:如何取得特殊資料夾的所在目錄?
下一篇:字串中文的問題