using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace linq2 { class Program { static void Main(string[] args) { // Console.WriteLine(new FileInfo(@"C:\Python\Python35-32\readme.txt").Length); // Console.WriteLine(String.Join("\n", Directory.GetFiles("C:\\Python\\Python35-32"))); Directory.GetFiles("C:\\Python\\Python35-32"). Select(fnimi => new FileInfo(fnimi).Length). ToList().ForEach(Console.WriteLine); Directory.GetFiles("C:\\Python\\Python35-32"). Select(fnimi => new { nimetus = fnimi.Split(new char[] {'\\'}).Last(), pikkus = new FileInfo(fnimi).Length}). OrderBy(obj => obj.pikkus).Where(obj => obj.pikkus>10000). ToList().ForEach(obj => Console.WriteLine("{0, -20}-{1, 10}", obj.nimetus, obj.pikkus)); //Sorteerige failid pikkuse jargi //Näidake faile, mis on pikemad kui 10kb } } }