Exemple #1
0
        static void Main(string[] args)
        {
            MyDiskInfoClient proxy = new MyDiskInfoClient();
            int    choice          = -1;
            string diskName;
            bool   goOn = true;

            do
            {
                Console.Write("Введите имя диска: ");
                diskName = Console.ReadLine();
                Console.WriteLine("1 - Вывести размер диска?\n2 - Вывести размер свободного пространства диска?\n0 - Выход");
                choice = Convert.ToInt32(Console.ReadLine());
                switch (choice)
                {
                case 0:
                    goOn = false;
                    break;

                case 1:
                    Console.WriteLine(proxy.TotalSpace(diskName));
                    break;

                case 2:
                    Console.WriteLine(proxy.FreeSpace(diskName));
                    break;

                default:
                    Console.WriteLine("Неверный вывод");
                    break;
                }
            } while (goOn);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            MyDiskInfoClient proxy = new MyDiskInfoClient();

            string free  = proxy.FreeSpace("D:");
            string total = proxy.TotalSpace("D:");

            Console.WriteLine("Free space: " + free);
            Console.WriteLine("Total space: " + total + "\n\n\n");
        }