c#之线程池

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 + "'";

posted @ 2016-06-16 11:16  尘梦  阅读(183)  评论(0编辑  收藏  举报