Created
April 18, 2016 10:47
-
-
Save ram0973/0331a141aa2de0fb84a8a92c421b3d2a to your computer and use it in GitHub Desktop.
Печать всех подкаталогов на C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
namespace DirsApp | |
{ | |
class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
DirectoryInfo root = new DirectoryInfo("."); | |
try | |
{ | |
DirectoryInfo[] Dirs = root.GetDirectories("*.*", System.IO.SearchOption.AllDirectories); | |
foreach (DirectoryInfo dir in Dirs) | |
Console.WriteLine(dir.Name); | |
} | |
catch | |
{ | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment