I have a WinForms GUI that has a 'help' context menu. When clicked, I would like to open the user manual for the application. The manual is a pdf which is stored within the application resources.
Question: How do I open this for the user?
Code I'm working with
System.Diagnostics.Process process = new System.Diagnostics.Process();
bool adobeInstall = false;
RegistryKey adobe = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe");
if (adobe != null)
{
RegistryKey acroRead = adobe.OpenSubKey("Acrobat Reader");
if (acroRead != null)
adobeInstall = true;
}
if (adobeInstall == true)
{
///Open the pdf file??
}
string locationToSavePdf = Path.Combine(Path.GetTempPath(), "file name for your pdf file.pdf"); // select other location if you want
File.WriteAllBytes(locationToSavePdf,Properties.Resources.nameOfFile); // write the file from the resources to the location you want
Process.Start(locationToSavePdf); // run the file
Try this (you need just a path to the PDF file, no need to add it to the resource):
using System.Diagnostics;
Process.Start(“Path_of_PDFFile”)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With