C#获取集合中的随机个数项
using System;
using System.Collections.Generic;
using System.Linq;
static class ExtensionMethod
{
public static IEnumerable<T> Random<T>(this IEnumerable<T> listT, int count)
{
return listT.OrderBy(l => Guid.NewGuid()).Take(count);
}
}