List<int> myList = new List<int>();
            myList.Add(6);
            myList.Add(7);
            myList.Add(8);
            myList.Add(9);

            List<int> myNewList = new List<int>();
            for (int k = 0; k < 4; k++)
            {
                int myRan = new Random().Next(0, myList.Count);
                int temp = myList[myRan];
                myList.Remove(temp);
                myNewList.Add(temp);
            }
           


本文转载:CSDN博客