【发布时间】:2011-06-19 21:35:09
【问题描述】:
在我的网站中,我想为需要在后台持续运行的进程创建一个单独的线程。我想使用线程,这样我的网站性能不会降低。
我想为下面的代码创建线程。
[WebMethod]
public void iterativeFunction()
{
int count = 0;
DateTime date1 = new DateTime(2011,5,31);
while (System.DateTime.Compare(System.DateTime.Now,date1)<0)
{
downloadAndParse();
count++;
}
}
我应该如何为这个函数添加一个新线程?
【问题讨论】:
标签: .net asp.net multithreading .net-3.5