using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;namespace ClassLibrary.Hardware { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.timer1.Interval = 1000; this.timer1.Enabled = true; } Random R = new Random(new Guid().GetHashCode()); private void timer1_Tick(object sender, EventArgs e) { for (int i = 0; i < 3; i++) { this.listBox1.Items.Add(R.Next(100)); }
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace ClassLibrary.Hardware
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
this.timer1.Interval = 1000;
this.timer1.Enabled = true;
}
Random R = new Random(new Guid().GetHashCode()); private void timer1_Tick(object sender, EventArgs e)
{
for (int i = 0; i < 3; i++)
{
this.listBox1.Items.Add(R.Next(100));
}
}
}
}