Include and Call PDF File in vb.net (after Deployement)

旧时模样 提交于 2019-12-12 02:26:22

问题


Glad to see this site, Thanks guys for being active. :)


I have a problem in Visual Studio 2010/VB.Net

I have windows form in Visual Basic, I deployed the software(form) to one installer Now I want to open My PDF file( i-e: Specific) with Button_Click_Event I know that:

Process.Start("MyPDF.pdf")

But I dont know if user install my software in his PC so may be he install the software in C D or other directory, and also I dont know How to include PDF file in my project :) Please suggest for me, I am searching this every where but failed so pl help me


回答1:


Use Add->Existing Item on your Project.
Then add the PDF File to your Project.
Afterwards you have to set the Properties of the newly added file to the following:


Now the file will be added to your "Output" Directory after you build your Project.
Now use your Process.Start("MyPDF.pdf") call. It will open up, as it resides in the same directory.




回答2:


This is rather easy: Simply include the file by dragging it to your project folder and in its options, tell it to copy to the build directory. Thereafter, find the path through the my.application methods. Build a correct path from that and launch it via process.start



来源:https://stackoverflow.com/questions/15901424/include-and-call-pdf-file-in-vb-net-after-deployement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!