-
- 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();
- }
- }
posted @
2013-09-25 14:24
王者杂货铺
阅读(
219)
评论()
编辑
收藏
举报