Hello,
I have written a C# console application that currently takes a data file as input, processes the data and writes out 2 new data files. I would like for it to be able to process ALL the files in a given directory. How might I do this? Thanks!
hotdang
0
Newbie Poster
Recommended Answers
Jump to PostYou can get a list of files in a directory by using the function Directory.GetFiles();
Here is an example that reads all the data from each file and stores it in the variable 'data'.
string directory = @"C:\"; foreach (string file in Directory.GetFiles(directory)) { string data …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.