I've a list of files and wish to check if these files are same (Content/Size)
IEnumerable<string> results = GetFiles("DirectorPath"); //This function returns the list of file names
foreach (string entry in results)
{
FileInfo fileInfo = new FileInfo(Path.Combine("C:\beta\source"), entry));
//How I do check if the elements of **results** are identical or not ??
//Problem is that the **results** may have (2,3,4) number of files, not same every time
}
What I tried is
foreach (string entry in results)
{
FileInfo fileInfo = new FileInfo(Path.Combine("C:\beta\source"), entry));
recentlyModFiles.Add(fileInfo); //Add the elements into another container and check for the content but will have to again use a forloop
}
Can someone help me with a better way to do this?
Let me know if any additional data is required
Thanks.
Edit : My problem statement has multiple (2,3,4..) number of files which are not same every time and not about just 2 files.