using System;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private async void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 100; i++)
{
listBox1.Items.Add(Rndm());
await Task.Delay(1);
}
}
private static string Rndm()
{
string rnd_string = string.Empty;
Random rnd = new Random();
for (int i = 0; i < 3; i++)
{
rnd_string += (char)rnd.Next(65, 90);
}
rnd_string += rnd.Next(1000, 10000);
return rnd_string;
}
}
}