Exemplo n.º 1
0
        /// <summary>
        /// 获取历史中奖次数
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        private static int GetHistoryWinningCount(string code)
        {
            var cacheData = HistoryLotteryHelper.GetContentFromCache();
            var strCode   = $"[{code}]";
            var count     = (cacheData.Length - cacheData.Replace(strCode, "").Length) / strCode.Length;

            return(count);
        }
Exemplo n.º 2
0
        void Application_Start(object sender, EventArgs e)
        {
            // 在应用程序启动时运行的代码
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            HistoryLotteryHelper.SetContentToCache();
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(OnRemoteCertificateValidationCallback);
        }