[RESOLVED] [VB.net] Referring to files within the project folder
If I was using code to refer to a file's location say "E:\files\1.doc" is there a way I can copy that 1.doc into the project folder and code it so the program will find it no matter where the project folder is without having to add the document as a resource...
I know when referring to databases you can use -
Dim ConString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Users.mdb"
The part I suspect I need being -
|DataDirectory|\Users.mdb"
Thanks for any help, Robin
Re: [VB.net] Referring to files within the project folder
Application.StartUpPath will give you the path you need.
Re: [VB.net] Referring to files within the project folder
And that will let me refer to items in the project folder if i move the project folder from my E: drive to C: drive?
Re: [VB.net] Referring to files within the project folder
It will return the folder where your EXE is located, wherever it may be.
Re: [VB.net] Referring to files within the project folder
Ok thanks a lot! Working now cheers.