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

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

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.

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

Related

How to install PDCurses with MinGW on Windows?

I have looked all over the internet for installation instructions but could not find one that actually worked. I have downloaded the MinGW-Get application as stated in many websites, but have no idea how to use it. I did find a website with the following instructions:
HOW TO INSTALL:
Install an ide on your windows machine, I’ll use the simple Dev-Cpp.
Download this zip containing the files you’ll need.
Create a folder called pdcurses and another one called include, inside
of it.
Extract panel.h and curses.h in the include fold.
Extract the .dll file in the pdcurses one.
Now open your ide and set the 32-bit version compiler as the default
one.
Create a new project, set it up.
On the lefty Treeview, right click on the project icon -> project
options
Go to -> Parameters tab-> Linker -> insert in its box the path to the
.dll file you extracted before
Go to -> Files/folders tab
Here you’ll see three inner tabs named: Libraries/Includes/resources
folders; inside each of them you have to insert the path to the
include folder you created before.
Source: https://hastalafiesta.altervista.org/setup-pdcurses-windows-devcpp/
However, I could not find the .dll or a library file in the PDCurses folder I extracted from the .zip file I downloaded from https://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/pdc34dllw.zip/download (as stated in the fifth step). I just got started with C++ and libraries and would appreciate it if anyone could provide me some guidance or any useful links.

Visual Basic 2010, finishing your project by getting the exe file from bin, or publishing

ok so i made a couple of projects in VB2010 and i want to finally make them a standalone executable , as i'm still a beginner in VB ! i don't know if getting the .exe file only from "bin/debug" or i should really publish it then need the applications folder and the setup [because it's gonna be a lot better if i don't have to do the second one], anyways i tried to get the exe file then move the project folder to another drive , and it work , i know that to run the exe in other computer i'll need framework , [as far as i know my resource files are embedded into the exe] but if i need framework only , i guess runing it on computers that doesn't have it will ask them to download it ! i don't mind that , or that option comes with publish ,and i also really need the manifest file to run it normally ,
I actually don't know much about this so can you pleas tell me what i exactly need so my .exe files can run on other computers
sorry for taking some of your time , and thank you for reading this :D
Set your Solution Configurations to Release, build a solution (Ctrl+Shift+B) then navigate to your bin/Release folder and there you will find your exe file ready to be shipped. You can ship that exe as is, or you can wrapp it up in an installer application. If your application has some dependencies then shipping the exe file will not be enough.
You can change your target framework by goin' to Project/Properties.
Find the .exe in \\Your app\bin\debug\your app.exe
What you can do,open the project as if going to edit it, just go to "Project" then "Publish(Whatever-your-work's-name-is).vb at the bottom. Then use the wizard to finish. At the end, say you saved your exe on the desktop, three files will appear.
"Whatever-your-work's-name-is".exe And its icon shape varies.
A folder called "Application Files"
And a "setup.exe" Its icon a like a CD on something.
For the first time, click on setup.exe and open the app. From then on, the "Whatever-your-work's-name-is".exe will open normally. I have a website where I publish these things for fun, "tgamer.myfreesites.net", and downloading will only download all three in a zipped folder. The website is not awesome, but it's alright.
The thing is, the setup.exe and application files can be in a zipped file. You only the actual exe from the second opening and onward. This option makes it downloadable, like what I want. For you, choose the best for you, but remember downloading only the exe will not work.

Create an EXE that has files in it

I want to create an Exe that copies files to a directory on the c drive.
So I want it to this.
I have added the files to the project.
And when I run the code. It copies the file.
My.Computer.FileSystem.CreateDirectory("C:\direcotory1")
My.Computer.FileSystem.CopyFile("file1", "c:\direcotry1\file1.dat")
The above code works, but...
After I compile if I move the exe out of the source directory, it doesn't work. I have to leave the exe in the directory where the file is.
Phrased another way. IF the exe is not in the directory it gets compiled into by Visual Studio. Then it cannot find the file to copy.
I know people do this all the time, but I am not sure how to get them in there.
Properties are set to content, or embedded resource don't seem to make a difference.
Can anyone give me the piece I am missing?
Thanks
Dan

How do i navigate through folders in code behind?

I need to address a file in my code. this file isn't located in my main project, but in a library project. When i call AppDomain.CurrentDomain.BaseDirectory, i end up in the start project's (let's call it mainproject) debug folder. What i want to to is call appdomain.cd.bd and go up 3 levels, so i leave debug, then bin and then mainproject. Then i would navigate to libraryproject and to folder where file is located.
What i've tried so far is do AD.CD.BD\..\.. or AD.CD.BD/../..
I thought i remembered those, but it's a no go.
Does anyone know how to do this.
Thanks in advance
It is concerning to see you wanting to codify paths based on project build paths. What happens when you release the project and these project directories don't exist.
I would recommend that if there is a file your project needs to execute is from a library project that doesn't get copied across during the build that you use a post build step to copy this file to the same location as your assembly. Alternatively you may be able to set the build action on the file in your project which might get this file to your main project build output directory.
Three levels up would be ../../../ wouldn't it?

Using Other Programmers Custom Controls

I am using Scott Mitchell's textBox Characters and Words counter control, i downloaded it from the website https://web.archive.org/web/20211020202742/https://www.4guysfromrolla.com/ and unzipped it to my desktop. then in VWD Express 2008, i created a new tab in the Toolbox, i chose the *.dll from the unzipped folder, i used the control, all is fine (try it, i recommend it) but when i backed up my code, copied the site, and tried to run it on another computer, i got a bunch of error all indicating that its looking for the dll file on my desktop, but when i checked under my bin folder in my website directory, the dll is there...
Help Plz...
If you view the properties of the reference you'll probably find that the path to the reference is incorrect.
I have often found that the quickest way of fixing the problem is to open the project file with notepad and correct the path to the reference.