|
-
Jan 12th, 2008, 09:04 AM
#1
Thread Starter
New Member
[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
-
Jan 12th, 2008, 09:11 AM
#2
Re: [VB.net] Referring to files within the project folder
Application.StartUpPath will give you the path you need.
-
Jan 12th, 2008, 09:14 AM
#3
Thread Starter
New Member
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?
-
Jan 12th, 2008, 09:18 AM
#4
Re: [VB.net] Referring to files within the project folder
It will return the folder where your EXE is located, wherever it may be.
-
Jan 12th, 2008, 09:19 AM
#5
Thread Starter
New Member
Re: [VB.net] Referring to files within the project folder
Ok thanks a lot! Working now cheers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|