Exemplo n.º 1
0
        private const Int32 REQUEST_TIMEOUT = 20000;//ms
        #endregion

        #region 用户方法
        /// <summary>
        /// 根据比赛信息地址获取最近比赛信息
        /// </summary>
        /// <param name="url">比赛信息地址</param>
        /// <returns>最近比赛信息</returns>
        public static async Task <String> GetAllRecentContestsJsonAsync()
        {
            String content = RecentContestCache.GetRecentContestCache();//获取缓存

            if (String.IsNullOrEmpty(content))
            {
                content = await RecentContestManager.GetAllRecentContestsJsonFromWebAsync();

                RecentContestCache.SetRecentContestCache(content);//设置缓存
            }

            return(content);
        }