forum

Home / DeveloperSection / Forums / FileInfo - Select one File out of one FileInfo[]

FileInfo - Select one File out of one FileInfo[]

Anonymous User 2019 04-Feb-2014

I have two FileInfo[] Array's and i want compare the Files with identical Names about their File Size and Last Modified Date. But how can i select a File out of a FileInfo[] with a specific Name?

My Code doesnt work, because i cant use FileInfo.Select to get a new FileInfo out. Any clues?

        foreach (FileInfo origFile in fiArrOri6)
        {
            FileInfo destFile = fiArrNew6.Select(file => file.Name == origFile.Name);
            if (origFile.Length != destFile.Length || origFile.LastWriteTime != destFile.LastWriteTime)
            {
                //do sth.
            }
        }

Thanks for any help :)

Any other charming solution for this Problem would be great. btw. #2 : does someone has good learning material for FileInfo?


c# c# 
Updated on 04-Feb-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By