Open CHM (help file) in C#

后端 未结 7 1543
花落未央
花落未央 2020-12-06 02:29

I\'m trying to open help file (chm extension) in C#.

File.Open(@\"//help.chm\",FileMode.Open, FileAccess.Read, FileShare.Read);

and

相关标签:
7条回答
  • 2020-12-06 02:59

    Simple do this

    Help.ShowHelp(ParentForm, "chmFile.chm", "link.htm");

    0 讨论(0)
  • 2020-12-06 03:03

    You can use -

    System.Windows.Forms.Help.ShowHelp(Control, String)
    

    So assuming you are in a Form/Control

    Help.ShowHelp(this, "file://c:\\helpfiles\\help.chm");
    

    ShowHelp method also provides overloads to go to specific topic and help page located inside the compiled HTML help file.

    Read System.Windows.Forms.Help.ShowHelp on MSDN

    Decompiling a CHM file

    Is as easy as executing below command in the command prompt.

    hh.exe -decompile <target-folder-for-decompiled-content> <source-chm-file>
    

    For Example:

    hh.exe -decompile C:\foo\helpchmextracted help.chm
    

    After executing the above command you should find the decompiled content in the C:\foo\helpchmextracted folder.

    0 讨论(0)
  • 2020-12-06 03:04

    Well the second line should be ok, if the file is not existent it should throw an exception. Need to be more specific about what you mean by " it doesn't work"

    0 讨论(0)
  • 2020-12-06 03:05
     Help.ShowHelp(this, AppDomain.CurrentDomain.BaseDirectory+"\\test.chm", HelpNavigator.Topic, "Welcome.htm");
    

    Welcome is id of the welcome age in chm file

    0 讨论(0)
  • 2020-12-06 03:11

    System.Diagnostics.Process.Start(@"c:\help.chm");

    0 讨论(0)
  •         string helpFileName = @"c:\help.chm";
            if (System.IO.File.Exists(helpFileName))
            {
                Help.ShowHelp(this, helpFileName );                
            }
    

    if this is not work try

            if (System.IO.File.Exists(helpFileName))
            {
                System.Diagnostics.Process.Start(helpFileName);              
            }
    
    0 讨论(0)
提交回复
热议问题