System.IO.DirectoryInfo is a class in the C# language that provides access to directory-level operations such as creating and deleting directories, accessing file attributes, and retrieving a list of files and subdirectories contained within a directory.
Example code:
1. Creating a new directory:
DirectoryInfo myDirectory = new DirectoryInfo(@"C:\mydirectory"); myDirectory.Create();
2. Retrieving a list of files contained within a directory:
DirectoryInfo myDirectory = new DirectoryInfo(@"C:\mydirectory"); FileInfo[] files = myDirectory.GetFiles();
3. Deleting a directory:
DirectoryInfo myDirectory = new DirectoryInfo(@"C:\mydirectory"); myDirectory.Delete();
These examples demonstrate just a few of the available operations that can be performed using the System.IO.DirectoryInfo class. The class is part of the .NET framework and can be found in the System.IO assembly.
C# (CSharp) System.IO DirectoryInfo - 60 examples found. These are the top rated real world C# (CSharp) examples of System.IO.DirectoryInfo extracted from open source projects. You can rate examples to help us improve the quality of examples.