JumboTCMS_src/JumboTCMS.WebFile/Global.asax.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
* 程序名称: JumboTCMS(将博内容管理系统通用版)
*
* 程序版本: 7.x
*
* 程序作者: 子木将博 (QQ:791104444@qq.com,仅限商业合作)
*
* 版权申明: http://www.jumbotcms.net/about/copyright.html
*
* 技术答疑: http://forum.jumbotcms.net/
*
*/
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.IO;
using System.Net;
using System.Web.Security;
using System.Web.SessionState;
using System.Timers;
namespace JumboTCMS.WebFile
{
public class Global : System.Web.HttpApplication
{
public static HttpContext myContext = HttpContext.Current;
protected void Application_Start(object sender, EventArgs e)
{
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new ElapsedEventHandler(TimeEvent);
aTimer.Interval = 1000;// 设置引发时间的时间间隔 此处设置为1秒
aTimer.Enabled = true;
}
private void TimeEvent(object source, ElapsedEventArgs e)
{
// 得到 hour minute second 如果等于某个值就开始执行某个程序。
int intHour = e.SignalTime.Hour;
int intMinute = e.SignalTime.Minute;
int intSecond = e.SignalTime.Second;
#region 每天的准点开始生成一次首页
//假设web服务异常或正常的重启,则强行执行一次任务(目的是为防止遗漏)
//if ((intMinute == 0 && intSecond == 0) || myContext.Application["AutoTask_1"] == null)
if ((intMinute == 0 && intSecond == 0))
{
string _url = ServerUrl() + "/plus/autotask.aspx?oper=CreateDefaultPage&password=" + System.Configuration.ConfigurationManager.AppSettings["AutoTask:Password"];
System.IO.StreamWriter sw = new System.IO.StreamWriter(myContext.Request.PhysicalApplicationPath + "\\_data\\log\\autotask_" + DateTime.Now.ToString("yyyyMMdd") + ".txt", true, System.Text.Encoding.UTF8);
sw.WriteLine(e.SignalTime.ToString());
sw.WriteLine(JumboTCMS.Utils.HttpHelp.Get_Http(_url, 10000, System.Text.Encoding.UTF8));
sw.Close();
sw.Dispose();
myContext.Application.Lock();
myContext.Application["AutoTask_1"] = "true";
myContext.Application.UnLock();
}
#endregion
}
后面还有 70 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。