您的位置:首页 > 编程语言 > C#

c#之线程池

2016-06-16 11:16 211 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;

namespace ConsoleApplication1
{
class Program
{
public delegate void del();
static void Main(string[] args)
{

Console.WriteLine("xsa");
//Thread t = new Thread(test);
//t.Start();

ThreadPool.QueueUserWorkItem(new WaitCallback(test));

Thread.Sleep(200);
Console.WriteLine("end");
Console.ReadKey();

}

static public void test(object par)
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine("sss");
Thread.Sleep(100);
}

}
}
}


  //string s = "select count(*) from t_t_cw_defaultitem where itemname=" + "'" + itemname + "'" + " and " + " itemchild=" + "'" + itemchild + "'" + " and " + "itemtermyear=" + "'" + itemtermyear + "'" + "," + " and " + "'" + itemoryear + "'";
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: