display .html pages, which is very easy in C#/.NET by using a web browser control
there are additional features you might want to implement like table of contents. Table of contents requires parsing out a CHMindex file and building a tree view with nodes (you can look at http://code.google.com/p/sumatrapdf/source/browse/trunk/src/ChmEngine.cpp for how we do it in Sumatra)
或许不会太难。你可以看看这个http://savannah.nongnu.org/projects/chmspec这是对 chm 文件格式的一个很好的猜测,因为微软从未发布过官方规范。从表面上看,它基本上是压缩的 html 文件的集合。解压后,您可以在嵌入式浏览器控件中打开 html 文件。普通的浏览器控件是基于 IE 的,但也有一些项目正在进行中,以创建 chrome 和 firefox 嵌入式控件。
It probably won't be too difficult. You can take a look at this http://savannah.nongnu.org/projects/chmspec which is a good guess at the chm file format as microsoft have never released the official spec. On the surface it is basically a collection of zipped html files. Once unzipped you could open the html files in an embedded browser control. The normal browser control is IE based but there are projects underway to create chrome and firefox embeddible controls.
发布评论
评论(2)
我用 C++ 编写了一个 chm 查看器,作为 SumatraPDF 的一部分(http: //blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html)。它是开源的,因此您可以将代码移植到 C# (http://code.google.com/p /苏门答腊pdf/)。
chm 阅读器只有几个部分:
I have written a chm viewer, in C++, as part of SumatraPDF (http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html). It's open-source so you could port the code to C# (http://code.google.com/p/sumatrapdf/).
There are just a few parts to chm reader:
或许不会太难。你可以看看这个http://savannah.nongnu.org/projects/chmspec这是对 chm 文件格式的一个很好的猜测,因为微软从未发布过官方规范。从表面上看,它基本上是压缩的 html 文件的集合。解压后,您可以在嵌入式浏览器控件中打开 html 文件。普通的浏览器控件是基于 IE 的,但也有一些项目正在进行中,以创建 chrome 和 firefox 嵌入式控件。
It probably won't be too difficult. You can take a look at this http://savannah.nongnu.org/projects/chmspec which is a good guess at the chm file format as microsoft have never released the official spec. On the surface it is basically a collection of zipped html files. Once unzipped you could open the html files in an embedded browser control. The normal browser control is IE based but there are projects underway to create chrome and firefox embeddible controls.