多线程Thread的使用,并使用Thread传参

                      //根据姓名获取邮箱名称
        protected void getEmail(string vipName,string code)
        {

                object[] ob = new object[] { email, code, vipName, like };   //参数

      Thread tr = new Thread(new ParameterizedThreadStart(sendEmail));  //sendEmail方法
                tr.Start(ob);    //ob参数

                }

 //发送邮件
        public void sendEmail(object ob)
        {

            object[] str = (object[])ob;
            string email = str[0].ToString(), code = str[1].ToString(), vipname = str[2].ToString(), like = str[3].ToString();

         ////

       }

posted @ 2011-11-08 15:03  zhaoping  阅读(228)  评论(0编辑  收藏  举报