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.IO;
- namespace Akademia_17_Wizytowka_Pro
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.BackgroundColor = ConsoleColor.White;
- Console.Clear();
- StreamReader plik = File.OpenText("wizytowka.txt");
- while (!plik.EndOfStream)
- {
- int kolor = int.Parse(plik.ReadLine());
- string tekst = plik.ReadLine();
- switch (kolor)
- {
- case 0: Console.ForegroundColor = ConsoleColor.Black; break;
- case 1: Console.ForegroundColor = ConsoleColor.Blue; break;
- case 2: Console.ForegroundColor = ConsoleColor.DarkGreen; break;
- case 3: Console.ForegroundColor = ConsoleColor.Red; break;
- }
- Console.WriteLine(tekst);
- }
- plik.Close();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement