c# - 打开 chm 文件目录的特定部分 c# 或 vb.net

标签 c# vb.net chm

我有一个名为 help 的 .chm 文件,在该文件中我的结构如下:

Introduction
  -item1
  -item2
Topic1
  -item1
  -item2
Topic2
  -item1
  -item2
Topic3

现在我想在我尝试过的 c# 或 vb.net 中打开 Topic1:

 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Index, "Topic1")
 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.TableOfContents, "Topic1")
 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Topic, "Topic1")
 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.KeywordIndex, "Topic1")

但不工作,然后我尝试在 chm 文件中给 Topic1 (31) 一个索引并尝试:

 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Index, "31")
 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Index, "Item1")

它给出了执行,唯一的工作代码是:

 Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.TableOfContents, Nothing)

如何打开主题1?

最佳答案

You can use the param parameter to provide further refinement of the Topic, TopicId, KeywordIndex, or AssociateIndex command. If the value specified in the command parameter is TableOfContents, Index, or Find, this value should be an empty string. If the command parameter references Topic, TopicId, KeywordIndex, or AssociateIndex, this value should be a string that contains the topic name, or the keyword or numeric identifier of the topic to display.

所以答案是:

Help.ShowHelp(ParentForm, "helpFile.chm", "topicURL.htm")

右键单击打开的主题找到的主题URL:

enter image description here

然后复制网址:

enter image description here

关于c# - 打开 chm 文件目录的特定部分 c# 或 vb.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19129639/

相关文章:

自 KB4338419 以来,无法再从经典 ASP 创建 C# COM 对象

c# - 如何获取 WebAPI Web 服务中可用方法的列表?

asp.net - 为什么我的 Webform 上的复选框对控制循环代码不可见?

playframework - Play Framework 的帮助是如何实现的?

C# - 如何使用帮助提供程序显示帮助文件?

c# - 如何计算 C# 中的类属性?

c# - 在数据库中更改表时是否可以刷新 gridview?

vb.net - 用于对具有空值的字段进行排序的表达式 Lambda

c# - Asp.net 日历控件中的 DropDownList

c++ - 仅在尚未打开 CHM 文件时打开它