我正在尝试使用System.Threading.Timer
. 它调用了该函数,但是它不起作用,并且不报告错误。为什么?
public class Timerr
{
ArrayList listurl;
ArrayList listcategory;
protected Collection<Rss.Items> list = new Collection<Rss.Items>();
RssManager reader = new RssManager();
System.Threading.Timer Timer;
System.DateTime StopTime;
public void Run()
{
StopTime = System.DateTime.Now.AddMinutes(1);
Timer = new System.Threading.Timer(TimerCallback, null, 0,1000);
}
private void TimerCallback(object state)
{
if (System.DateTime.Now >= StopTime)
{
Timer.Dispose();
return;
}
callrss();
}
}