using System; using System.Diagnostics; using System.Threading;
namespace BaiDu { class Program { static void LaunchNotePad() //启动记事本的函数 { Process.Start("notepad"); }
static void Main(string[] args) { Thread []thread = new Thread[10]; // 创建10个线程 for (int i = 0; i < 10; i++ ) { thread[i] = new Thread(new ThreadStart(LaunchNotePad)); //每个线程启动一个记事本 }
for (int i = 0; i < 10; i++ ) // 启动10个线程 { thread[i].Start(); }
Console.ReadKey(); } } } |