zoukankan      html  css  js  c++  java
  • 静态页面处理 远程

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Threading;
    using SF;

    namespace Shumi.Stocks.MvcSite
    {
        public partial class Static : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                //if (Request.QueryString["user"] != "shumiwang")
                //{
                //    Response.Redirect("http://www.fund123.cn"); ;
                //}
            }

            protected void btnCreateIndex_Click(object sender, EventArgs e)
            {
                //Thread thread = new Thread(StockIndexStaticItem);

                //thread.Start();


                IUpdateDependency update = new SlidingUpdateTime(new TimeSpan(0, 1, 0));
                var url = "http://" + HttpContext.Current.Request.Url.Host;
                IStaticPageItem item = new SingleStaticPageItem(url + "/WebForm2.aspx", Server.MapPath("/default.html"), "最新分时图", update);
                item.IsRemote = true;

                StaticPageManager.AddItem(item);
                StaticPageManager.OnError += new StaticErrorHandler(StaticPageManager_OnError);
                StaticPageManager.Start(1000, true);
            }

            void StaticPageManager_OnError(Exception ex)
            {
                SF.Mail.SmtpMail.Instance.SendExceptionAsync(ex, "exception", "maoyong@fund123.cn");

                throw new NotImplementedException();
            }

            private void StockIndexStaticItem()
            {
                try
                {
                    DateTime time = DateTime.Today.Add(new TimeSpan(12, 0, 0));
                    StaticService.GetStockIndexStaticItem(time).Update(time);
                }
                catch { }
            }
        }
    }

  • 相关阅读:
    SpringBoot
    SpringBoot
    MySQL
    Database
    Database
    MySQL
    Debug
    《mysql必知必会》学习_第18章
    C#中访问私有成员
    精彩语录收集
  • 原文地址:https://www.cnblogs.com/mylife_001/p/1946331.html
Copyright © 2011-2022 走看看