C # generate a CHM File (Application)

Source: Internet
Author: User
In the previous article, we learned how to use csung to call hhc.exe to generate a CHM file. In the middle article, we performed CHM decompilation and converted the CHM File into Word. In the next article, I will briefly introduce how these technologies are applied in actual projects.

Advantages of CHM ebook:

1. The best part of CHM is its support for web pages and images. In fact, this format is similar to a lite version of IE browser with directories and indexes.
2. the most convenient way for CHM full-text search is to highlight the results.

At the same time, e-books in CHM format also have some disadvantages: first, the system must be a windows system, and must be more than 98 systems with browsers with ie3 and above, and cannot be annotated.

We can see that the help documentation of general software is generally in CHM format, which is one of the reasons why CHM e-books are popular.

The following describes how to apply the technology mentioned in the first two articles in practice.

1.we can make a chmeditor. Of course, the compiler is still hhc.exe, And we just made a package.
2. You can define your own CHM template to create a beautiful CHM e-book, provided that the template is in HTML format.
3. You can combine BHO programming to save your favorite webpage content directly to the CHM e-book format, or save it locally, and then compile it as a CHM e-book.
4. decompile existing CHM e-books into html files and convert CHM to word.

The above ideas are for reference only. If you have any good ideas, please leave me a message.

The first point is implemented below.

Reason

I found that some editors cannot insert formatted code, that is, the inserted code cannot be in a good display format, and there is no syntax to enable the code. So I always wanted to make an editor like this, in the beginning, many html editors support code insertion. For example, the blog editor and csdn editor support code insertion. However, because of the poor web portability, either the database needs to be installed or iis support is required, so we want to make it cs.

Let's take a look at the preview effect,

This is the main interface. You can enter keywords for query and fuzzy query (using Lucene. Net to store the index of keywords)

 

This is the editing page, which contains WebBrowser. Click submit to save the content in the editor as an html page, and save the text in the keyword as an index for later query.

 

The CHM compilation interface. below is the output information during compilation.

 

This is the CHM file after compilation and supports syntax highlighting.

 

 

Idea:

This editor can be used as a programmer's code library editor to store frequently-used code in different categories. If necessary, CHM can be generated for easy reading and query by keyword or title (not implemented yet)

 

The beta version of the program is available for download below. Many features are not available yet. Sorry.

 

Download code library Editor (Basic Version)

 

 

PS: I wanted to write the application article earlier. Since the computer broke down after the 11 s, I was in a hurry to get a simple version of the program after it was repaired, and the search interface function was not started yet, put it there first, hey ....

1. Only C # code is implemented when the system language is highlighted.

2. The last icon in the toolbar is compiled as CHM. Other icons cannot be used ....

3. To run this Program, install. net framework2.0. hhc.exe and hha. dll exist in the C: \ Program Files \ HTML Help Workshop directory.

4. If you are interested, I can share with you how to implement this small software. If you think you want to implement this step, please recommend it, 3Q

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.