コード例 #1
0
ファイル: CDNResults.cs プロジェクト: AHartTN/CascIt_Console
        public CDNResults(string url)
        {
            string response = Traffic.HTTPGET(url);

            if (string.IsNullOrWhiteSpace(response))
            {
                Results = null;
                return;
            }

            List<string> lines = response.Replace("\r", "")
                .Split('\n')
                .Where(w => !string.IsNullOrWhiteSpace(w))
                .ToList();
            lines.RemoveAt(0);
            Results = lines.Select(s => new CDNResult(s));
            Console.WriteLine("{0} CDN results retrieved!", Results.Count());
        }
コード例 #2
0
        public VersionResults(string url, CDNResults cdnResults)
        {
            CDNResults = cdnResults;
            string response = Traffic.HTTPGET(url);

            if (response == null)
            {
                Results = null;
                Console.WriteLine("Zero (0) Version results retrieved! Probably a bad program code?");
                return;
            }

            List <string> lines = response.Replace("\r", "")
                                  .Split('\n')
                                  .Where(w => !string.IsNullOrWhiteSpace(w))
                                  .ToList();

            lines.RemoveAt(0);

            Results = lines.Select(s => new VersionResult(s, cdnResults));
            Console.WriteLine("{0} Version results retrieved!", Results.Count());
        }