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 { }
            }
        }
    }

  • 相关阅读:
    A. SwapSort
    D. A Shade of Moonlight
    利用DataSet更改数据,将更改保存到数据库中
    接口设计与数据同步解决方案小结
    SQL 判断 ‘表,存储过程,函数 ...’ 已是否存在
    SQL Server系统表sysobjects介绍与使用
    【转】SQL Server 2008 事件探查器(SQL SERVER Profiler)
    SQL 常用语句
    网页开发 组件
    中文版的jqGrid实例大全
  • 原文地址:https://www.cnblogs.com/mylife_001/p/1946331.html
Copyright © 2011-2022 走看看