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?


2 답변


0

Try This.

string path= Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()));


0

try this

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

and if you want to get your project directory use

string path = Directory.GetCurrentDirectory();

Linked


Related

Latest