导航

黑马程序员----多线程练习

Posted on 2011-12-04 10:14  asp.net 开发  阅读(195)  评论(0)    收藏  举报
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace duoxiancheng
{
public partial class FormThread : Form
{
public FormThread()
{
InitializeComponent();
}

private void btnSingleThread_Click(object sender, EventArgs e)
{
count();
}
void count()
{
for (int i = 0; i < 999999999; i++)
{

}
MessageBox.Show("循环完毕~~~~");
}

private void btnMoreThread_Click(object sender, EventArgs e)
{
Thread threadFirst = new Thread(count);
threadFirst.Start();
}

}
}