Relative paths in C#
Posted
by Suraj
on Stack Overflow
See other posts from Stack Overflow
or by Suraj
Published on 2010-04-24T15:40:00Z
Indexed on
2010/04/24
15:43 UTC
Read the original article
Hit count: 592
I need some help with paths please!
Basically I have a project with the following folder structure:
Project (root directory which contains the .sln file etc.)
Project/MyProj (contains the code)
Project/MyProjTest (the test folder)
Project/TestResults
Now with this Project I need to have a common folder where I can stick a bunch of files for use with the Application without having to copy the files to multiple locations etc. What is the best way to do this? Ideally I would like to have the folder as Project/ResourcesFolder, so that both the Code folder and Test folder can access it. Now if this is the case how do I call this folder from within C#? I've tried Application.StartupPath, Environment.GetCurrentDirectory but they both just return the CURRENT folder which is not what I want.
Thanks in advance.
© Stack Overflow or respective owner