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 Раскрытие_ФС
- {
- class Program
- {
- static void showFileSystem(string strPath, int i)
- {
- Console.ForegroundColor = ConsoleColor.White;
- foreach (string f in Directory.GetFiles(strPath))
- {
- Console.WriteLine((new string(' ', i + 1)) + '+' + Path.GetFileName(f));
- }
- Console.ForegroundColor = ConsoleColor.Green;
- foreach (string s in Directory.GetDirectories(strPath))
- {
- Console.WriteLine((new string(' ', i)) + '-' + Path.GetFileName(s));
- Console.ResetColor();
- showFileSystem(s, i + 1);
- }
- }
- static void Main(string[] args)
- {
- string strPath;
- int i = 1;
- Console.WriteLine("Введите путь к папке:");
- strPath = Console.ReadLine();
- showFileSystem(strPath, i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement