Beispiel #1
0
        /// <summary>
        /// 建立。
        /// </summary>
        /// <param name="sport">運動類型</param>
        public BasicFollow(ESport sport)
        {
            // 設定
            this.Sport = sport;
            this.GameData = new Dictionary<string, BasicInfo>();
            this.OldData = new Dictionary<string, BasicInfo>();
            this.UpdataWriteLine = true;

            // 建立記錄檔操作
            this.Logs = new LogFile(sport);
            this.FileWrite = true;

            this.UrlSetting = new UrlSetting();
            //读取来源网
            this.sWebUrl = UrlSetting.GetUrl(sport);
        }
Beispiel #2
0
        public BasicDownload(ESport sport, string url, Encoding encoding, string fileType = null)
        {
            this.downloadTimer = new Timer();
            this.downloadTimer.Interval = timeoutValue;
            this.downloadTimer.Tick += TimerEventProcessor;

            this.Logs = new LogFile(sport, fileType);

            // 建立
            this.Sport = sport;
            this.Uri = new Uri(url);

            if (this.Uri.ToString().IndexOf("bet007.com") != -1)//奧訊來源
            {
                this.UrlList = UrlSetting.GetBet007Url();
                this.ProxyList = ProxySetting.GetBet007Proxy(); // 取得奧訊代理
            }

            if (this.Uri.ToString().IndexOf("d.asiascore.com") != -1)//asiascore來源
                this.ProxyList = ProxySetting.GetAsiascoreProxy(); // 取得asiascore代理

            if (this.Uri.ToString().IndexOf("www8.spbo1.com") != -1 || this.Uri.ToString().IndexOf("www8.spbo.com") != -1)//足球走勢來源
                this.ProxyList = ProxySetting.GetSpbo1Proxy(); // 取得足球走勢代理

            if (this.ProxyList == null || this.ProxyList.Count <=0)
                this.ProxyList = ProxySetting.GetProxy(sport); // 取得代理

            this.Client = new WebClientEx();
            //this.Client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
            this.Client.Encoding = encoding;

            this.Client.DownloadDataCompleted += this.Client_DownloadDataCompleted;
            this.Client.DownloadStringCompleted += this.Client_DownloadStringCompleted;

            // 建立記錄檔操作
            this.FileWrite = true;

            //奧訊代理 使用順位
            ProxyUsing = 0;//預設值0
        }
Beispiel #3
0
        public BkWNBA(DateTime today)
            : base(ESport.Basketball_WNBA)
        {
            this.Logs = new LogFile(ESport.Basketball_WNBA);//設定log type
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://scores.espn.go.com/wnba/scoreboard";
            }
            if (string.IsNullOrWhiteSpace(this.sWebUrl1))
            {
                this.sWebUrl1 = @"http://espn.go.com/wnba/boxscore?gameId={0}";
            }
            // 設定
            this.AllianceID = 19;
            this.GameType = "BKUSW";
            int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            if (diffTime > 0)
                this.GameDate = today.AddHours(-diffTime);
            else
                this.GameDate = GetUtcUsaEt(today);//取得美東時間

            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl); // 以網站的資料頁面為主
            this.DownScore = new Dictionary<string, BasicDownload>();
        }