[英]How to open a resource pdf file in its native browser from within a c# application?
I have a pdf file for example C:\myfile.Pdf我有一个 pdf 文件,例如 C:\myfile.Pdf
Currently I can launch the file from C# code using目前我可以使用 C# 代码启动文件
System.Diagnostics.Process.Start("C:\myfile.pdf") System.Diagnostics.Process.Start("C:\myfile.pdf")
However i will prefer to embed this file as a resource.但是我更喜欢将此文件作为资源嵌入。
How do i accomplish the same result.我如何实现相同的结果。 Process.Start(new ProcessStartInfo(nameof(MyNamespace.Properties.Resources.myfile)));//This will not work
Process.Start(new ProcessStartInfo(nameof(MyNamespace.Properties.Resources.myfile)));//这个不行
If I copy the pdf file into the projects Bin\Release folder then I can simply use the same line of code above.如果我将 pdf 文件复制到项目 Bin\Release 文件夹中,那么我可以简单地使用上面的同一行代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.