-
asp.net配置全局应用程序类 巧妙达到定时生成静态页面
-
- public class Global : System.Web.HttpApplication
- {
- static Timer BuildStaticPagesTimer;
- static object locker = new object();
- static int count;
-
- protected void Application_Start(object sender, EventArgs e)
- {
-
- if (BuildStaticPagesTimer == null)
- {
- lock (locker)
- {
- if (BuildStaticPagesTimer == null)
- {
-
- BuildStaticPagesTimer = new Timer(BuildStaticPagesTimer_Callback, null, 0, 20 * 60 * 1000);
- }
- }
- }
- }
-
- private static void BuildStaticPagesTimer_Callback(object state)
- {
- Dictionary<string, string> urlsNeedToBuild = GetPagesNeedToBuiltStatic();
- foreach (string oldUrl in urlsNeedToBuild.Keys)
- {
- string newUrl = urlsNeedToBuild[oldUrl];
- Build(oldUrl, newUrl);
- }
- }
-
- private static void Build(string oldUrl, string newUrl)
- {
-
- throw new NotImplementedException();
- }
-
- private static Dictionary<string, string> GetPagesNeedToBuiltStatic()
- {
-
- throw new NotImplementedException();
- }
- }
-
相关阅读:
CF140CNew Year Snowmen
ZR10.1青岛集训三地联考
CF1228——记一次和紫名失之交臂的CF
CF1220
codeforce 382 div2 E —— 树状dp
codeforce 381 div2
codeforce 380(div.2)
Bishops Alliance—— 最大上升子序列
codeforce 379(div.2)
模板——BigInteger
-
原文地址:https://www.cnblogs.com/codeloves/p/3338675.html
Copyright © 2020-2023
润新知