Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Threading;
- namespace WebApp
- {
- class Program
- {
- static void DisplayFeeds(List<string> feeds, Dictionary<string, string> covid19Info)
- {
- int i = 0;
- while(i < feeds.Count)
- {
- if(i == feeds.Count - 1)
- {
- i = 0;
- }
- else if(i % 2 == 0 && i % 5 == 0)
- {
- DisplayCovid19Info(covid19Info);
- }
- Thread.Sleep(1000);
- Console.WriteLine("Tin tức mới nhất: " + feeds[i]);
- i++;
- }
- }
- static void DisplayCovid19Info(Dictionary<string, string> info)
- {
- string[] content =
- {
- "",
- "==============================================",
- ">> THẾ GIỚI",
- "Số ca mắc: " + info["WorldTotalConfirmed"],
- "Số ca tử vong: " + info["WorldTotalDeaths"],
- "Số ca hồi phục: " + info["WorldTotalRecovered"],
- "==============================================",
- ">> VIỆT NAM",
- "Số ca mắc: " + info["VietnamTotalConfirmed"],
- "Số ca tử vong: " + info["VietnamTotalDeaths"],
- "Số ca hồi phục: " + info["VietnamTotalRecovered"],
- "==============================================",
- "",
- };
- Console.WriteLine(string.Join("\n", content));
- }
- static void Main(string[] args)
- {
- Console.OutputEncoding = Encoding.UTF8;
- Modules.ReadFeeds readFeeds = new Modules.ReadFeeds();
- var feeds = readFeeds.ReadRssFeed();
- var covid19Info = readFeeds.GetCovid19Info();
- DisplayFeeds(feeds, covid19Info);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement