About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Working with Directories

As you know, directories are containers for files and other directories and thus provide a hierarchical means of organizing data. This is almost accurate because there are ways to create cycles on a file system. Ignoring this detail, you should already have an idea about what the DirectoryInfo will expose. Let’s take a look by means of an example:

Console.Write("Enter path: ");var path = Console.ReadLine();Console.WriteLine();var folder = new DirectoryInfo(path);if (folder.Exists){    Console.WriteLine("Full name: " + folder.FullName);    Console.WriteLine("Name: " + folder.Name);    Console.WriteLine("Created: " + folder.CreationTime);    Console.WriteLine("Parent: " + folder.Parent.FullName); ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required