[問題] ASP如何以binary形式讀取資料?

看板Web_Design作者 (恩)時間19年前 (2006/12/06 16:36), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串1/1
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

12/07 02:12, , 1F
試試OpenAsBinaryFile (亂猜的名稱 因為我不知道這是什麼)
12/07 02:12, 1F

12/07 02:12, , 2F
(你可能要查一下是否有這樣的函式)
12/07 02:12, 2F

12/13 09:33, , 3F
請愛用google,請參考:http://psacake.com/web/gj.asp
12/13 09:33, 3F
文章代碼(AID): #15Te4c3n (Web_Design)