【问题标题】:open specific part of table of contents of chm file c# or vb.net打开 chm 文件 c# 或 vb.net 目录的特定部分
【发布时间】:2013-10-08 09:46:07
【问题描述】:

我有一个名为 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)

如何打开Topic1?

【问题讨论】:

    标签: c# vb.net chm


    【解决方案1】:

    您可以使用 param 参数进一步细化 Topic、TopicId、KeywordIndex 或 AssociateIndex 命令。如果值 命令参数中指定的是 TableOfContents、Index 或 Find, 这个值应该是一个空字符串。如果命令参数 引用 Topic、TopicId、KeywordIndex 或 AssociateIndex,此值 应该是一个字符串,包含主题名称、关键字或 要显示的主题的数字标识符。

    所以答案是:

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

    在打开的主题上右击找到的topicURL:

    然后复制网址:

    【讨论】:

      猜你喜欢
      • 2014-04-13
      • 2012-04-30
      • 2015-12-04
      • 2018-10-30
      • 2017-03-10
      • 2021-03-22
      • 2012-01-01
      • 2019-12-03
      相关资源
      最近更新 更多