using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWareCommon.Utils { /// /// LIST帮助类 /// public class ListHelper { /// /// LIST打乱顺序 /// /// 要处理的LIST /// 打乱顺序后的LIST public static List RandomList(List oldList) { Random r = new Random(Guid.NewGuid().GetHashCode()); List newList = new List(); foreach (var item in oldList) { newList.Insert(r.Next(newList.Count), item); } return newList; } } }