Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Friday, March 12, 2010

Threading

public void ThreadJob()
{
for (int i = 0; i < 10; i++)
{
MessageBox.Show(i.ToString());
Thread.Sleep(1000);
}
}
public void ThreadJob1()
{
for (int i = 0; i < 10; i++)
{
MessageBox.Show(i.ToString());

Thread.Sleep(2000);
}
}
private void button2_Click(object sender, EventArgs e)
{
ThreadStart job = new ThreadStart(ThreadJob);
ThreadStart job1 = new ThreadStart(ThreadJob1);
Thread thread = new Thread(job);
Thread thread1 = new Thread(job1);
thread.Start();
thread1.Start();
}

No comments:

Post a Comment