I have a folder in C:\Name\Folder\
and I have several files.
I need to display the full path to the files in this folder.
It should display all files in the format C:\Name\Folder\file.txt
. My code is as follows:
string[] filePaths = Directory.GetFiles(@"C:\Name\Folder\"); for (int i = 0; i < filePaths.Length; ++i) { string path = filePaths[i]; Console.WriteLine(System.IO.Path.GetFileName(path)); }
It prints only the file name, but I also need to print the full path to the file.
Illep source share