C#如何在我的项目资源中打开PDF?

sta*_*low 4 c# pdf

我有一个带有"帮助"上下文菜单的winfrom GUI.点击后,我想打开该应用程序的用户手册.手册是pdf,存储在应用程序资源中.

问题:如何为用户打开此文件?

代码我正在与之合作

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??
}
Run Code Online (Sandbox Code Playgroud)

coo*_*ine 6

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
Run Code Online (Sandbox Code Playgroud)