پاسخ ها ( ۲ )

  1. using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace backgroundcolor
    {
    class Program
    {
    static void Main(string[] args)
    {

    Console.WriteLine("Insert Your Color :");

    string z= Console.ReadLine();

    switch (z.ToLower())
    {

    case "red":
    Console.BackgroundColor = ConsoleColor.Red;
    Console.Clear();

    break;

    case "green":
    Console.BackgroundColor = ConsoleColor.Green;
    Console.Clear();
    break;

    case "blue":
    Console.BackgroundColor = ConsoleColor.Blue;
    Console.Clear();
    break;

    case "yellow":
    Console.BackgroundColor = ConsoleColor.Yellow;
    Console.Clear();
    break;

    default:
    Console.BackgroundColor = ConsoleColor.Black;
    Console.Clear();
    break;
    }

    Console.ReadKey();

    }
    }
    }

  2. سلام وقت بخیر،

     

ارسال یک پاسخ