O'Reilly logo

Pro C# 2010 and the .NET 4 Platform, Fifth Edition by Andrew Troelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

20.3. Working with the DirectoryInfo Type

The first creatable I/O-centric type you will examine is the DirectoryInfo class. This class contains a set of members used for creating, moving, deleting, and enumerating over directories and subdirectories. In addition to the functionality provided by its base class (FileSystemInfo), DirectoryInfo offers the key members in Table 20-3.

Table 20.3. Key Members of the DirectoryInfo Type
MemberMeaning in Life
Create() CreateSubdirectory()Create a directory (or set of subdirectories) when given a path name.
Delete()Deletes a directory and all its contents.
GetDirectories()Returns an array of DirectoryInfo objects that represent all subdirectories in the current directory.
GetFiles()Retrieves an array of FileInfo ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required