我有一个名为 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:
然后复制网址:
关于c# - 打开 chm 文件目录的特定部分 c# 或 vb.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19129639/