Tuesday, April 8, 2008

LINQ Sample

var processes =
Process.GetProcesses().Where(process => process.WorkingSet64 > 20 * 1024 * 1024)
.OrderByDescending(process => process.WorkingSet64)
.Select(process => new { Id = process.Id, Name = process.ProcessName });

foreach (var obj in processes)
{
Response.Write(obj.Id +" & "+ obj.Name +"
");
}

No comments: