Let's say that I have a folder called C:\MyFolder. Inside that folder I have a bunch of files (no sub directories are present).
I want to perform an action on each file in this folder.
What is a good way for me to get a list of all files and then act on them one by one?
Right now I'm doing something that just feels more convoluted than it needs to be.
I'm getting a list of files and redirecting that output to a text file. Then I open the text file and read line by line into a string array to get a list of files.
Is there not some more direct way to populate an array with the names of all the files in a folder?