📅  最后修改于: 2022-03-11 14:48:51.352000             🧑  作者: Mango
string[] names = new string[] { "name1", "name2", "name3" };
Random rnd = new Random();
int index = rnd.Next(names.Length);
Console.WriteLine($"Name: {names[index]}");