Want to Distribute PDF file with my Visual Basic Project during Deploying

前端 未结 2 1168
粉色の甜心
粉色の甜心 2021-01-17 01:42

I have Visual Basic (Visual Studio Professional Edition, .NetFrameWork 4.0) I want to include and Call PDF with my Button_Click_Event I include MyPDF.pdf in

2条回答
  •  -上瘾入骨i
    2021-01-17 02:15

    Wah!!! Great And finally I am able to open any file in other machine
    I did this by ordinary methods so I was failed I am going to explain for those who wana learn:
    1)= I add PDF file by clicking on properties in solution explorer, then I select Resources, In Resources I add "Add Existing Item" So PDF is added to my project in "Resources" folder

    2)= After that I click on PDF in solution explorer and Change Build Action to : Content (even none also works) and Copy to output directory to: Copy always (As suggested by you :))

    3)= So whats wrong, actually compiler make folder outside bin folder and we all paste only Release folder(when we deploying, I actually do this lol), so i just cut(Ctrl+X) Resource folder and paste inside in Release folder, and call by this code:

    Process.Start("Resources\MyPDF.pdf")

    I am sure if we copy the PDF file directly in Release folder so this will also work with this code:

    Process.Start("MyPDF.pdf")

    I am sure this will help for those who are in search of this!
    Thank you guys who help me. Jazakallah

提交回复
热议问题