众所周知,程序员往往有很多小的文档要收集,比如大量的零散的txt和html文件。针对这个问题,已经有前辈做了努力,比较著名的就是藏书架、超级文档管理器等程序。
但是,似乎这些程序现在都不更新了。我想问一下,现在有哪几款这种类型的程序比较好。 作为程序员,当然不会满足于拿来就用。对藏书架程序的内部实现我也很有兴趣,想讨论一下。
首先是存储结构,这类程序大多是使用数据库实现,那么,如果是使用access2000的mdb文件存储的话,在没有安装access2000的系统上,需要携带哪些文件过去才能让程序顺利执行呢。其它数据库又该怎样做。
关于存储结构,我在想,是否可以使用XML,将整个文件组合变成一个XML文件。XML的树型结构恰好可以对应存储时所使用的目录结构。
其次是关于html的内部解析,尤其是图片。一个带有图片的html在存入数据库时,为了显示正常,肯定要把图片同时存入。那么,在html中类似<img src=logo.gif >这样的结构,他的src部分要指向何处呢,假设我使用IE控件来解析html。
但是,似乎这些程序现在都不更新了。我想问一下,现在有哪几款这种类型的程序比较好。 作为程序员,当然不会满足于拿来就用。对藏书架程序的内部实现我也很有兴趣,想讨论一下。
首先是存储结构,这类程序大多是使用数据库实现,那么,如果是使用access2000的mdb文件存储的话,在没有安装access2000的系统上,需要携带哪些文件过去才能让程序顺利执行呢。其它数据库又该怎样做。
关于存储结构,我在想,是否可以使用XML,将整个文件组合变成一个XML文件。XML的树型结构恰好可以对应存储时所使用的目录结构。
其次是关于html的内部解析,尤其是图片。一个带有图片的html在存入数据库时,为了显示正常,肯定要把图片同时存入。那么,在html中类似<img src=logo.gif >这样的结构,他的src部分要指向何处呢,假设我使用IE控件来解析html。
解决方案 »
- 求大神帮忙解决一下这个问题吗。。
- 关于vs2008的资源文件的位图问题
- 奇怪!vs2008 向导 添加任何东西 都失败!
- 进程独立地址空间,'独立' 两个字如何理解
- 我用一个客户端的应用程序访问服务端的数据库,如何实现最简便、高效?
- 关于TransparentBlt的问题,内详,附代码,请进!解决马上结贴
- 请问如何获得光驱里光盘的卷标阿?
- access里面删除纪录后为什么数据库文件越变越大?
- 那位老兄推荐基本用vc编写dll的书籍(有一些深度的)来者有分
- 这个小程序该怎么改?目的是输出5,也就是分数最大的那个数组里的5
- 为什么按下CTRL+F5时,只有Release版本改变,Debug版本没有按程序改变而改变??
- 怎样可以将CString转化成HKEY,是个麻烦事?
1。目录使用XML,考虑平台的移植,使用xerces(开源),注意中文问题.如果只用于WIN平台,可以用MSXML
2。文档使用RTF格式。用文档/视图的结构,以后可以扩充支持更多的格式,如CHM,HTML,MHT(重点)
3。文档内容存储用自已写的格式,已经写完了,带压缩,用ACCESS太大了,存多了不好,以前是用ACCESS,后面换了。如果考虑平台的移植,更不行。注XML做文档存储不好,一个是二进制的存储问题,用BASE64,占用空间,二是用DOM读取时要全部读进内存才能解析。SAX是只读。
基本就这样,希望对你有帮助
对于数据存储,是否可以考虑自带一个MySQL数据库?这样从存储数据量和检索速度上会有很大的优势。
对CHM的内部结构,是否有人了解呢,请贡献一些看法!
-------This is documentation on the .chm format used by Microsoft HTML Help. This format has been reverse engineered in the past, but as far as I know this is the first freely available documentation on it. One Usenet message indicates that these .chm files are actually IStorage files documented in the Microsoft Platform SDK. However, I have not been able to locate such documentation. Note
----The word "section" is badly overloaded in this document. Sorry about that.All numbers are in hexadecimal unless otherwise indicated in the text. Except in tabular listings, this will be indicated by $ or 0x as appropriate. All values within the file are Intel byte order (little endian) unless indicated otherwise. The overall format of a .chm file
----------------------------------The .chm file begins with a short ($38 byte) initial header. This is followed by the header section table, the offset to the content, and a number of bytes of information of unknown use. Collectively, this is the "header". The header is followed by the header sections. There are two header sections. One header section is the file directory, the other contains the file length and some unknown data. Immediately following the header sections is the content. The Header
-----------The header starts with the initial header, which has the following format 0000: char[4] 'ITSF'
0004: DWORD 3 (Version number)
0008: DWORD Total header length, including header section table and
following data.
000C: DWORD 1 (unknown)
0010: DWORD a timestamp.
0014: DWORD Windows Language ID. The two I've seen
$0409 = LANG_ENGLISH/SUBLANG_ENGLISH_US
$0407 = LANG_GERMAN/SUBLANG_GERMAN
0018: GUID {7C01FD10-7BAA-11D0-9E0C-00A0-C922-E6EC}
0028: GUID {7C01FD11-7BAA-11D0-9E0C-00A0-C922-E6EC}Note: a GUID is $10 bytes, arranged as 1 DWORD, 2 WORDs, and 8 BYTEs.It is followed by the header section table, which is 2 entries, where each entry is $10 bytes long and has this format: 0000: QWORD Offset of section from beginning of file
0008: QWORD Length of sectionFollowing the header section table is 8 bytes of additional header data. In Version 2 files, this data is not there and the content section starts immediately after the directory. 0000: QWORD Offset within file of content section 0
http://www.speakeasy.org/~russotto/chm/chmformat.html