Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a help file created and i have kept in my project directory.
I want to open the help file on button click. I don't know how to set the path for that help file so that after making setup file of my application i will be able to run the Help file on button click.
If i keep the help file in my debug folder it runs but if i keep it anywhere else it says cannot find the path..
Please help me where to keep the file and how to set path to that file so that after making setup and install it in my PC, the button click should open the help file.

Thanks in advance...
Posted
Comments
VICK 1-Oct-13 8:42am    
Not familiar with window forms. But i have done the same in web application through the following code snippet.. Myt be it could help you... i have placed this code in button click event.. and it gets a excel file from template folder...


Response.ContentType = "Application/xlsx";
Response.AppendHeader("Content-Disposition", "attachment; filename=filename.xlsx");
Response.TransmitFile(Server.MapPath("~/Templates/filename.xlsx"));
Response.End();

Keep it in the application directory - or better create a subdirectory for help files called "Help" and stick it in there. (The installation program should be able to do that for you automatically)
You can then access it via the Application.StartupPath property by adding "\Help\MyHelpFile.ext".
 
Share this answer
 
You can use something like this.
C#
Process.Start("notepad.exe", "C:\\Users\\gaurav_joshi\\My Documents\\test.txt")

assuming your help file is a simple text file.

-SG


[Edit member="Tadit"]
Corrected formatting and grammatical issues.
[/Edit]
 
Share this answer
 
v2
It is good that if you keep it in the bin folder of your application. So that when you install or execute the help file remains in the bin folder itself.

you can use the below code to open the file on button click event.

C#
private void OpenHelp()
{
    System.Diagnostics.Process.Start(Application.StartupPath + "\\NAME_HELP.chm");
}

Hope it helps you.
 
Share this answer
 
Visit Open CHM (help file) in C#[^].


[Edit member="Tadit"]
Link text added to reflect the Article/QA title.
[/Edit]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900