O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

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

System.IO

To demonstrate some of the classes available in the System.IO namespace, a Directory application was built in the Directory directory. By recursing through the directory structure, you can make use of the Directory, File, FileInfo, and DirectoryInfo classes. (This sample application is available in the Directory directory.) Listing B.55 shows a code snippet that initializes a tree control with drive and directory information.

Listing B.55. Filling the TreeControl with File, Directory, and Drive Information
private void InitializeTreeControl()
{
// Initialize TreeControl.
// Populate the TreeView with data.
// First add the root node.
rootNode = new TreeNode("My Computer", (int)ImageListTypes.Computer, (int)ImageListTypes
.Computer); ...

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