作者Tillor (恩)
看板Web_Design
標題[問題] ASP如何以binary形式讀取資料?
時間Wed Dec 6 16:50:23 2006
objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream=objFSO.OpenAsTextFile(FilePath,ForReading,False,0)
For I = 1 To 353 Step 1
StrFileContent=objTextStream.Read(1)
Response.write "I=" & I &":" & Hex(Asc(StrFileContent))
Response.write "<br/>"
Next
我是開啟一個jpeg的檔案
以下是UltraEdit顯示的結果
FF D8 FF E1 01 5D 45 78 69 .....
如果用上面的方法讀的話是
FF 3F 3F 5D 45 78.....
看來這個方法似乎不能正確的一個位元一個位元讀取檔案
不知道要怎樣才能正確的讀取呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.48.176
1F:推 LPH66:試試OpenAsBinaryFile (亂猜的名稱 因為我不知道這是什麼) 12/07 02:12
2F:→ LPH66:(你可能要查一下是否有這樣的函式) 12/07 02:12