Global.asax 问题 觉得红色字体有问题。直接调用this.open()可以了吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 open() 是在单独的类中,所以 abc a = new abc(); a.open(); 应该不是这个问题 private Timer ti;定义在哪里?如果在Global里面,那么你在abc如何饮用得到?如果在abc里面, abc的生命周期只在Application_Start范围内, Application_Start执行完了, abc将会被回收,Timer ti也将会被一起回收掉。修改方法:private Timer ti;void Application_Start(object sender, EventArgs e) { open(); }open(){ti = new Timer(); ti.Elapsed += new ElapsedEventHandler(ti_Elapsed); ti.Enabled = true; ti.Interval = 1000;}private void ti_Elapsed(object sender, ElapsedEventArgs e) {//任务代码...} vs2008怎么正确导入非express版的sqlserver数据库文件 问个数据存储的问题,就10分,别嫌少啊 无法System.Web.Mail名空间? 怎么样用Javascript播放Flash???? 谢谢!!!! 求建议---如何学好C#编程语言???忘赐教 没人用过speech sdk吗??发了3个帖都没人理?? ado.net中如何把文件存放在数据库的二进制字段中? 郁闷,散分 c#z中DateTime格式问题 寻求.net的研究生研究课题? 調試出現錯誤,問題何在?聽說可以用funtion?怎么用 C#
abc a = new abc();
a.open();
应该不是这个问题
private Timer ti;void Application_Start(object sender, EventArgs e)
{
open(); }
open()
{
ti = new Timer();
ti.Elapsed += new ElapsedEventHandler(ti_Elapsed);
ti.Enabled = true;
ti.Interval = 1000;
}
private void ti_Elapsed(object sender, ElapsedEventArgs e)
{
//任务代码...
}