If what you are asking for is:
Supply a directory name ("MyExcelSpreadheets2010" for example)
Call a method which returns the fully qualified path to that directory.
string fileName = "MyExcelSpreadheets2010";
string path = GetFullPathFromJustTheDirectoryName(fileName);
expected path to contain "C:\WhereIKeepThings\Documents\Mine\ThisYear\MyExcelSpreadheets2010"
Then no. It doesn't exist. You will have to write it.
Think about it:
What if it isn't on C:, but on your DVD drive? Or your other HDD? Or a networked drive? USB drive, which happens to be in your pocket?
What if you have two directories with the same name? I do - lots. "bin" and "debug" are prime examples, but there are loads of others.
"Thats just the mattar. I cant se all the trees for the hole forest. What I mean is. Writing the code that gets the path without consideration to the mentiond problems. The problems where it is or is not, I can firure out. Lets just say it is on C:\. What I need just now is a push in the right direction. What Clases and methods, to use in what order can be a great help."
Ah! You should have said!
You need to set up a recursive method which looks at all the directories in a given path.
This will be a bit brief, because I'm pushed for time today (work just gets in the way, doesn't it?) You need to look at the
Directory
class:
bool Directory.Exists(path)
string[] Directory.GetDirectories(path)
Look them up on MSDN - there are probably examples.
You will probably need to have some kind of "found it - abort" flag for your recursive method, and I recommend testing on a small sub-branch of C:\ - it is probably worth setting up a small test directory with a known structure for testing.