public static void UseFilesAndFoldersHelper_GetMultipleFiles_action(string pRootFolder, string pOutputResult) { ListOfElements <string> loes = ListOfElements <string> .CreateListOfElements <string>((x) => x, (x) => x); FileAndFolderService ffs = new FileAndFolderService(); List <IFileOrFolder> list = ffs.GetListOfFilesAndFolders(pRootFolder, ElementSelection.file); list.Sort(fafh.File.CompareByNameAndDirectory); int countDuplicates = 0; for (int i = 1; i < list.Count; i++) { if (Path.GetFileName(list[i - 1].FullName) == Path.GetFileName(list[i].FullName)) { loes.TheList.Add(list[i - 1].FullName); loes.TheList.Add(list[i].FullName); countDuplicates++; } } Console.WriteLine(countDuplicates); loes.WriteToFile(pOutputResult); }
public static void ReadWriteList() { ListOfElements <string> loe = ListOfElements <string> .CreateListOfElements <string>((x) => x, (x) => x); loe.ReadFromFile(@"E:\Temp\ToDelete\file1.txt"); loe.TheList.Add("tititi"); loe.WriteToFile(@"E:\Temp\ToDelete\file11.txt"); }