Specifying a relative path

前端 未结 4 913
孤城傲影
孤城傲影 2021-01-13 07:20

I have a windows forms project. In the current directory I have a Help folder with *.chm files. What is the easiest way to launch them from the application? How can I specif

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 07:58

    The easiest is

    Process.Start("myHelpFile.chm");
    

    This will open the chm file in the systems default program associated with that file type.

    This will work as long as the chm file is located in the same directory as your exe. If you have a sub folder called help, the path will be @"Help\myHelpFile.chm".

提交回复
热议问题