String[] date = { "小罗", "水黄", "水饭", "菊明", "坑坚" };
Random random = new Random();
int index = random.Next(0, date.count);
t1.Text = date[index];
data.removeAt(index);
int index1 = random.Next(0, date.count);
t2.Text = date[index1];
data.removeAt(index1);
int index2 = random.Next(0, date.count);
t3.Text = date[index2];
data.removeAt(index2);
int index3 = random.Next(0, date.count);
t4.Text = date[index3];
data.removeAt(index3);
int index4 = random.Next(0, date.count);
t5.Text = date[index4];
这样子吗? |