asp.net中的多线程

Multi Threading in ASP.NET

下面示例启动一线程,调用Web服务WebService1的方法: SendMail(string message,string email)


using System;

using System.Threading;

public class MyThreadClass

{                  

   public void StartThread()

   {

         Thread T = new Thread(new ThreadStart(Run));

         T.Start();

   }                  

   private void Run()

   {                                      

        WebService1.SendMail("hello thread","[email protected]");

   }

                 

}


启用线程:

MyThreadClass T = new MyThreadClass();

T.StartThread();
(Source:  http://www.codecomments.com/ASP_.NET/message351969.html )

你可能感兴趣的:(thread,多线程,String,webservice,asp.net,web服务)