/// <summary> /// 更新热点(最新Top10) /// </summary> /// <returns></returns> public static Boolean LoadResourcesTop10() { ResourceTop10 = new DataSet.ResourceDataTable(); DataUtils.Arrange(ResourceTop10, ConfigUtils.ServerProtocol.ListResourceTop10()); //保存到本地 return(SaveResourcesTop10()); }
/// <summary> /// 获得每日分享列表(全体) /// </summary> /// <returns></returns> public static Boolean LoadAllResources() { //按照年/日.XML格式保存(文件内保存左右分享信息列表) //yyyy/MM/dd HH:mm:ss #region 获取本地分享数据最后更新日期(文件列表) String FilePath = ConfigUtils.DataFileSavePath + FilePathUtils.LOCAL_RES + @"\" + DateTime.Now.ToString("yyyy"); String[] LocalPaths = Directory.GetDirectories(FilePath); //获取最大的日期路径 Int32 LastPath = Int32.MinValue;//YYYYMMDD foreach (String NowPath in LocalPaths) { if (LastPath <= Int32.Parse(NowPath)) { LastPath = Int32.Parse(NowPath); } } #endregion #region 获得网络数据 List <String> CloundPaths = ConfigUtils.ServerProtocol.ListResourceFilePath(LastPath.ToString()); #endregion #region 保存到本地 FilePath = ConfigUtils.DataFileSavePath + FilePathUtils.LOCAL_RES + @"\" + DateTime.Now.ToString("yyyy") + @"\" + DateTime.Now.ToString("yyyyMMdd"); DataSet.ResourceDataTable Resurces = new DataSet.ResourceDataTable(); DataUtils.Arrange(Resurces, CloundPaths); Resurces.WriteXml(FilePath); #endregion return(true); }
/// <summary> /// 获得最新分享(本地展示) /// </summary> /// <returns></returns> public static Boolean ReadResourcesTop10() { ResourceTop10 = new DataSet.ResourceDataTable(); ResourceTop10.ReadXml(ConfigUtils.ResourceTop10FileName); return(true); }