public class Global : System.Web.HttpApplication
{
private System.Timers.Timer aTimer = new System.Timers.Timer();protected void Application_Start(Object sender, EventArgs e)
{
Application["DDL_XGS"] = TInitWebPage.getXGSSL();
Application["DDL_XCYR"] = TInitWebPage.getXCYRSL();
Application["DDL_BLJYR"] = TInitWebPage.getBLJYRSL();
aTimer.Elapsed+=new ElapsedEventHandler(OnTimedEvent);
aTimer.Interval=300000; //五分钟
aTimer.Enabled=true;
}
public static void OnTimedEvent(object source, ElapsedEventArgs e)
{
Application["XGS"] = TInitWebPage.getXGSSL();
Application["XCYR"] = TInitWebPage.getXCYRSL();
Application["BLJYR"] = TInitWebPage.getBLJYRSL();
}
}
这是我的代码的一部分,编译时提示“error CS0120: 非静态的字段、方法或属性“System.Web.HttpApplication.Application”要求对象引用”
为什么?