Thumbs.db是Windows XP、Server 2003和Mac OS X中存儲圖片(JPEG, BMP, GIF, TIF)及一些文檔(PDF, HTM)縮略圖的緩存文件。在Windows資源管理器以縮略圖形式查看文件時生成Thumbs.db,并保存在各自的目錄中。默認的Thumbnail尺寸是96*96(需要修改注冊表更改默認的尺寸)。 “微軟復合文檔二進制結(jié)構(gòu)(Compound File Binary Format)”是一種結(jié)構(gòu)化的存儲格式,它在一個文件里模擬磁盤存儲格式,使得文件內(nèi)部變得像一個磁盤,用來存放結(jié)構(gòu)化信息。微軟沒有公開具體格式,卻大量地使用,最常見的是 Offfice 的文件格式。符合微軟復合文檔二進制結(jié)構(gòu)規(guī)范的對象叫 Storage 對象,Compound File 是一種 Storage 對象,DocFile 是一種 Compound File。雖然沒公開具體規(guī)范,但幸好微軟提供了訪問這種格式的 API 和工具 DocFile Viewer。Thumbs.db也屬于這種復合文件格式。 實現(xiàn)讀取Thumbs.db文件的API StgOpenStorage用來打開文件系統(tǒng)中一個已有的根storage對象。使用該函數(shù)可以打開復合文件,但不能用來打開目錄、文件、或者summary catalogs。嵌套的storage對象只能被他們的父親IStorage::OpenStorage 打開。不過,在Windows 2000及XP下應(yīng)該使用StgOpenStorageEx。 IStorage支持創(chuàng)建和管理structured storage對象,Structured storage允許在一個文件內(nèi)分層的存儲信息,經(jīng)過被認為是一個文件內(nèi)的文件系統(tǒng)。Elements of a structured storage object are storages and streams. Storages are analogous to directories, and streams are analogous to files. IStream支持流對象的讀寫數(shù)據(jù)。Stream objects contain the data in a structured storage object, where storages provide the structure. Simple data can be written directly to a stream but, most frequently, streams are elements nested within a storage object. They are similar to standard files. 相關(guān)例程及資料 COM structured storage from .NET(http://www.vsj.co.uk/articles/display.asp?id=628)重點推薦的一篇文章 A brief description of .DB files(http://www.accessdata.com/media/en_US/print/papers/wp.Thumbs_DB_Files.en_us.pdf) |