日期:2014-05-19  浏览次数:20755 次

怎么给一个线程调用的方法传参
Thread   thread   =   new   Thread(new   ThreadStart(ThreadProc));


        private   void   ThreadProc()
        {
                string   strScript   =   " <script> setPgb( 'pgbMain ', '{0} '); </script> ";
                for   (int   i   =   0;   i   <=   100;   i++)
                {
                        System.Threading.Thread.Sleep(100);
                        Response.Write(string.Format(strScript,   i));
                        Response.Flush();
                }
        }
ThreadProc()这个方法我想传个参数给他,但是new   Thread是ThreadProc方法不能传参,怎么办呢?

------解决方案--------------------
意思是这个意思了.

Response在这里不能用啊。
-------------------------
你可以把你的Page传到这个类里啊.