private void button1_Click(object sender, EventArgs e)
{
int x0 = Int32.Parse(textBox3.Text);//最小值
int x1 = Int32.Parse(textBox1.Text);//最大值
int x2 = Int32.Parse(textBox2.Text);//取值个数
listBox1.Items.Clear(); //listbox刷新
int[] num = new int[x2];
for (int i = 0; i < num.Length; i++)
{
Random rand = new Random();
int n;
n = rand.Next(x0, x1);
if (n == num[i]) { }
else
{
num[i] = n;
}
listBox1.Items.Add(num[i]);
}
}