每天开火一次 [英] firing once a day

查看:76
本文介绍了每天开火一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须每天开机一次,


我认为每天的第一次打击都会导致它运行。

我会保持跟踪global.asax和会话变量中的那个?

解决方案

" JP.Gantlin" < bi ******** @ bitefdfme.netwrote in message

news:%2 ****************** @ TK2MSFTNGP02。 phx.gbl ...


i必须每天开机一次,



什么样的例程...?


我认为每天的第一次命中将导致它运行。



你的意思是第一次有人点击你的网站,因此,在任何一天运行

Application_Start ......?


我会跟踪global.asax和会话变量吗?



显然你不能将它存储在Session变量中,因为一旦Session自动超时,就会丢失
或被拆除

手动...


你也不能将它存储在一个应用程序变量中(我认为这是什么

你的意思是在global.asax中跟踪它,因为你的所有

应用程序变量将在最后剩余的会话时间消失

自动退出或手动拆除并且Application_End触发...


之所以我问这是什么样的例程是因为,一般来说

说话,ASP.NET并不是特别适合这种事情,因为上面的原因 - 一个Windows服务或一个SQL Server工作就好了吗?b $ b几乎肯定会好一些解决方案,如果你可以使用...


你可以将它放入会话开始部分,在开火前检查日期和状态。

" JP.Gantlin" < bi ******** @ bitefdfme.net在留言新闻中写道:%2 ****************** @ TK2MSFTNGP02.phx.gbl ...


>我必须每天开机一次,


我认为每天的第一次打击会导致它我想跟踪global.asax和会话变量吗?

" Jon Paal" < Jon [nospam] Paal @where dot在消息中撰写

新闻:OU **************** @ TK2MSFTNGP03.phx.gbl ...


你可以将它放入会话开始部分,



这意味着每次新访问无论是否需要,网站都会(尝试)运行这个

...


在开火前检查日期和状态。



" Checking"怎么样,确切地说......?如果你的意思是检查数据库,那么

每个Session_Start将创建一个完全不必要的数据库

调用...

i gotta routing to fire off once a day,

I figure the first hit of each day will cause it to run.
would i keep track of that in the global.asax and a session variable?

解决方案

"JP.Gantlin" <bi********@bitefdfme.netwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...

i gotta routing to fire off once a day,

What sort of routine...?

I figure the first hit of each day will cause it to run.

You mean the first time someone hits your website and, therefore, runs
Application_Start on any given day...?

would i keep track of that in the global.asax and a session variable?

Clearly you can''t store this in a Session variable, because that will be
lost as soon as the Session times out automatically or is torn down
manually...

You also can''t store this in an Application variable (I presume that''s what
you mean by "keeping track of it in global.asax"?), because all your
Application variables will disappear when the last remaining Session times
out automatically or is torn down manually and Application_End fires...

The reason I asked what sort of routine this is is because, generally
speaking, ASP.NET is not particularly suited to this sort of thing for
precisely the above reasons - a Windows service or a SQL Server job would
almost certainly be a much better solution, if they are available to you...


you could put it into the session start section , checking the date and status, before firing.
"JP.Gantlin" <bi********@bitefdfme.netwrote in message news:%2******************@TK2MSFTNGP02.phx.gbl...

>i gotta routing to fire off once a day,

I figure the first hit of each day will cause it to run.
would i keep track of that in the global.asax and a session variable?



"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
news:OU****************@TK2MSFTNGP03.phx.gbl...

you could put it into the session start section,

Which would mean that every new visit to the site would (try to) run this
whether it needed to or not...

checking the date and status, before firing.

"Checking" how, exactly...? If you mean checking against a database, then
every Session_Start is going to make a completely unnecessary database
call...


这篇关于每天开火一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆