In this blog, we will create a c# program that prints a list of all files from a particular directory with the file name.
Files In Directory
Code
Explanation
- In above code we get directory/ folder info by passing our folder path in DirectoryInfo Constructor.
- Then we create an array of FileInfo and get all files which are in our directory by our variable d.
- Then iterate that FileInfo array and print file name one by one.
Output
0 Comments