using System; using System.IO; namespace CB.LotteryCatchData.Entity { /// /// 彩种配置信息 /// public class LotteryConfigInfo { /// /// 彩票名称 /// public string Name { get; set; } /// /// 临时配置存放路劲 /// public string Path { get; set; } /// /// 数据抓取地址 /// public string DataUrl { get; set; } /// /// HTTP请求超时时间 /// public int TimeOut { get; set; } /// /// 周期内起始开奖时间格式 /// public string OpenTimeFomart { get; set; } /// /// 周期内起始时间 /// public TimeSpan StartTime { get; set; } /// /// 开奖频率、开奖周期(分钟) /// public int OpenPeriod { get; set; } /// /// 周期内结束时间 /// public TimeSpan EndTime { get; set; } /// /// 实现彩种数据抓取ICatchDataProvider接口的类类型 /// public string CatchDataProvider { get; set; } /// /// 序列化xml /// /// public override string ToString() { return string.Format("{8}", this.Name, this.Path, this.TimeOut, this.OpenTimeFomart, this.StartTime, this.OpenPeriod, this.EndTime, this.CatchDataProvider, this.DataUrl); } /// /// 获取临时配置文件路劲 /// /// public string GetParamKeyPath() { if (string.IsNullOrEmpty(this.Path)) throw new FileNotFoundException("请设置Config\\CatchDataConfig.xml配置文件对应【" + this.Name + "】彩种的Path属性值"); string path = AppDomain.CurrentDomain.BaseDirectory + "Config\\" + this.Path + "\\"; if (!Directory.Exists(path)) Directory.CreateDirectory(path); return path + "tmpDataConfig"; } } }