我認爲鏈接文件在本地開發文件夾和生成的版本「\ bin」文件夾中有不同的位置。請確保所有文件(CHM和PDF)具有相同的位置,並且始終在您的應用程序發行文件夾中發佈。
如果這可能不會幫助,請看看以下在討論串中提到的樣本下載: How to open specific topic from a chm file?
我的方式通過的Process.Start做(例如只 - 這是不是最好的方法):
private void button1_Click(object sender, EventArgs e)
{
string helpFilePath = Application.StartupPath + @"\help-subfolder\C-Sharp-CHM-example.chm";
// Verify if the file exists
if (File.Exists(helpFilePath))
{
Process.Start(helpFilePath);
}
else
{
Console.WriteLine(string.Format("File not found [{0}]", helpFilePath));
}
}
帶有一些測試鏈接的幫助文件位於子文件夾中。任何地方都可以進行測試,我自己創建了一個CHM文件進行測試,並且沒有鏈接到PDF的問題。我的Visual Studio 2015社區位於Windows 10機器上。
我記得的一些32/64位的問題。請參閱以下鏈接並注意您需要HTML鏈接中的target = _blank。
https://helpman.it-authoring.com/viewtopic.php?f=30&t=12508
我不太清楚,但是這是你的代碼示例中一個錯字pDokumantasyonCHMFile.Start()?; => pDokumantationCHMFile.Start(); –
是的,我用這種方式啓動chm – tebdilikiyafet