int n = 100,max = 200,min=100;
Random random = new Random();
List<int> list = new List<int>(100);
for (int i = 0; i < n; i++)
{
//若max-min<n将进入无限循环
int temp = random.Next(min, max);
if (list.Contains(temp) == true)
{
i--;
continue;
}
else
{
list.Add(temp);
}
}