In the current window that I have, I have a button. I want you to be able to click the button and open the .pdf file, which is located in the resources folder of this project. Is it easy to do?
Other methods that I examined use file paths, but file paths may not be the same all the time, but the .pdf file will always be in the resources folder. Is there any way to access this and open it at the click of a button?
Anything along the lines?
string filename = "instructions.pdf"; file.open();
Problem resolved with
private void Button1_Click(object sender, EventArgs e) { string filename = "instructions.pdf"; System.Diagnostics.Process.Start(filename); }
With .pdf instructions in the bin / debug folder where the program.exe file is located.
source share