troubleshooting Question

Only able to load the interest, I need to load both files at the same time. Only latest files

Avatar of sue Tons
sue Tons asked on
C#
3 Comments1 Solution18 ViewsLast Modified:
var account= Directory.GetFiles(rootDirectory, "Account*.txt").OrderByDescending(d => new FileInfo(d).CreationTime).First();
                var interest= Directory.GetFiles(rootDirectory, "Interest*.txt").OrderByDescending(d => new FileInfo(d).CreationTime).First();

                string[] file = new string[]
                 {
                     account,
                     interest
                 };
                Array.Sort(file);
                foreach (var latestFile in file)
                {

                    _parserLog.WriteLine("Latest file found was: " + latestFile);

                    Load(latestFile);

txt files in the directory
Account20210528
Account20210430
Interest202100528
Interest20210430
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros