namespace WinFormsApp1
{
public partial class Form1 : Form
{
public static float money = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
const int cycleNum = 60;
ThreadPool.SetMaxThreads(5,5);
// for (int i = 1; i <= cycleNum; i++)
// {
ThreadPool.QueueUserWorkItem(run, 1000);
// }
Thread.Sleep(1000);
MessageBox.Show(money.ToString());
}
private void run(Object mny) {
money = int.Parse( mny.ToString())+3000;
}
}
}