我正在尝试在C#中打开帮助文件(chm扩展名).
File.Open(@"//help.chm",FileMode.Open, FileAccess.Read, FileShare.Read);
Run Code Online (Sandbox Code Playgroud)
和
FileStream fileStream = new FileStream(@"c:\help.chm", FileMode.Open);
Run Code Online (Sandbox Code Playgroud)
不起作用:(
abh*_*ash 25
您可以使用 -
System.Windows.Forms.Help.ShowHelp(Control, String)
Run Code Online (Sandbox Code Playgroud)
所以假设你在Form/Control中
Help.ShowHelp(this, "file://c:\\helpfiles\\help.chm");
Run Code Online (Sandbox Code Playgroud)
ShowHelp
方法还提供重载以转到位于已编译的HTML帮助文件内的特定主题和帮助页面.
在MSDN上读取 System.Windows.Forms.Help.ShowHelp
反编译CHM文件
就像在命令提示符下执行以下命令一样简单.
hh.exe -decompile <target-folder-for-decompiled-content> <source-chm-file>
Run Code Online (Sandbox Code Playgroud)
例如:
hh.exe -decompile C:\foo\helpchmextracted help.chm
Run Code Online (Sandbox Code Playgroud)
执行上述命令后,您应该在C:\foo\helpchmextracted
文件夹中找到反编译的内容.
小智 6
string helpFileName = @"c:\help.chm";
if (System.IO.File.Exists(helpFileName))
{
Help.ShowHelp(this, helpFileName );
}
Run Code Online (Sandbox Code Playgroud)
如果这不起作用,请尝试
if (System.IO.File.Exists(helpFileName))
{
System.Diagnostics.Process.Start(helpFileName);
}
Run Code Online (Sandbox Code Playgroud)