/// <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); }
void Application_Start(object sender, EventArgs e) { // 在应用程序启动时运行的代码 AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); HistoryLotteryHelper.SetContentToCache(); ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(OnRemoteCertificateValidationCallback); }