如何从VS Lightswitch中的按钮打开chm文件

时间:2012-05-28 12:09:24

标签: c# visual-studio-lightswitch

我需要在按钮的 can_execute()方法中添加什么样的代码才能打开我为lightswitch应用程序制作的.chm帮助文件以及如何确保即使在发布整个应用程序... .chm文件会自动传输到用户的计算机中并保留在正确的目录中? .....谢谢!

 partial void Help_Execute()
    {
        // Write your code here.

        if (AutomationFactory.IsAvailable)
        {
            dynamic shell = AutomationFactory.CreateObject("Shell.Application");
            shell.ShellExecute("C:/Users/Thuto/Documents/Visual Studio 2010/Projects/ElectricalContructors/ElectricalContructors/Client/Resources/SparkHelpDocumentation.chm", "", "", "open", 1);
        }
        else
        {
            this.ShowMessageBox("Automation not available");
        }

    }

经过一个小时的尝试找到一个更好的方式我尝试了这个并且它有效,但我想知道这样做的正确方法,谢谢!

1 个答案:

答案 0 :(得分:0)

这是一篇关于在客户端创建图像嵌入资源的文章。我没有尝试使用.chm,但我不明白为什么它不起作用。

http://blogs.msdn.com/b/bethmassi/archive/2011/06/15/adding-static-images-and-text-on-a-lightswitch-screen.aspx