1

In my project, I added a folder with files in it. They all have a local path.

I want to have a string array with all the paths to all of those files, but I have no clue how to do that.

I tried this, but it only returns strings in the format of "namespace+project+foldername+name".

string[] test = Assembly.GetExecutingAssembly().GetManifestResourceNames();

What I want is the full path:

D:\Projectname\Project\Folder\file.ext

It would also help to get the reference/path to the folder, because then I could get the files with:

System.IO.Directory.GetFiles();

Anyone got an idea?

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
  • string test = System.AppDomain.CurrentDomain.BaseDirectory; made it. found here: http://stackoverflow.com/questions/14549766/how-to-get-my-project-path – user3616874 Sep 11 '14 at 13:34

2 Answers2

0

Try This.

string path= Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()));
Romo Daneghyan
  • 2,099
  • 3
  • 18
  • 23
0

try this

string[] files= Directory.GetFiles(@"directory");

and if you want to get your project directory use

string path = Directory.GetCurrentDirectory();
Ateeq
  • 797
  • 2
  • 9
  • 27