如何在C#中将.chm文件附加到我的项目 [英] how to attach .chm file to my project in c#

查看:105
本文介绍了如何在C#中将.chm文件附加到我的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用软件word2doc在c#.net中创建了.chm文件.
现在,我想将该.chm文件附加到项目的帮助选项中,我该怎么办?
请帮忙.

I have created .chm file in c#.net with software word2doc.
now, i want to attach that .chm file to my project''s help option how can i do it?
please help.
thanks in advance.

推荐答案

要使用代码中的chm,请查看Help命名空间,尤其是Help.ShowHelp.
例如:
To use your chm from code have a look to the Help namespace, and especially Help.ShowHelp.
For example:
//this will open the chm file
System.Windows.Forms.Help.ShowHelp(this, "yourFile.chm");
//this will open the chm file and display a topic using its id
int id = 150;
System.Windows.Forms.Help.ShowHelp(this,"yourFile.chm",
    HelpNavigator.TopicId, id.ToString());
//this will open the chm file and display a html page
System.Windows.Forms.Help.ShowHelp(this, "yourFile.chm",
    HelpNavigator.Topic, "page.htm");



要使用主题ID,您必须将ID映射到html页面.如果您不知道如何执行此操作,请在Word2Doc文档中进行搜索.我不知道该软件,所以我无能为力.



To use topic Ids, you must map the ids to the html pages. If you don''t know how to do this, search in Word2Doc documentation. I don''t know this software so I can''t help further.


您可以将文件作为资源包含(捆绑到可执行文件中),或将其设置为输出作为内容,然后进行处理.从帮助菜单中将其启动.
You could include the file as a resource (bundle it into the executable), or set it to be output as content, then Process.Start it from your help menu.


这篇关于如何在C#中将.chm文件附加到我的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆