Exercises
Create a new ASP.NET application using the same code as the I/O application to enable you to select directories and list their contents from the browser. An application like this could be used to list Web site contents and allow users to download files, or as an administration tool for listing files and directories and creating new file and directories.
Look up the FileAttributes enumeration in the .NET Framework SDK. This enumeration gives the attributes of files on the operating system. Next, write a simple console application that uses the GetFiles method of the Directory class, and write the code that returns the attributes of the files in the root of your C drive. You can refer to Listing 9.5, where you used the GetFileSystemEntries method to retrieve files and folders.
Create a new Windows Forms application that enables you to set the LastAccessTime and LastWriteTime for files on your file system. To accomplish this, add a TreeView control, two DateTimePicker controls, and a CommandButton to the default Form1 of the new application that you create. The idea is to get and set the values of the LastAccessTime and LastWriteTime for files in the file system. Here''''s the code you need to write:
Using the methods of the File and Directory class, fill the TreeView with the contents of your C drive.
Each time you click a node in the TreeView, set the DateTimePicker values with the current LastAccessTime and LastWriteTime values.
In the click event for the Set New Times button, add code to reset the LastAccessTime and LastWriteTime for the selected file.
Your form should look like Figure 9.17.
Figure 9.17. Sample of the Exercise 3 application.

• Table of Contents
• Index
Sams Teach Yourself Visual Studio® .NET 2003 in 21 Days
By
Jason Beres
Publisher
: Sams Publishing
Pub Date
: January 14, 2003
ISBN
: 0-672-32421-0
Pages
: 696
Sams Teach Yourself Visual Studio .NET in 21 Days will help developers that are new to application development and experienced developers understand how to use the .NET Framework and Visual Studio .NET to rapidly develop any type of computer application. The Visual Studio .NET development environment is the most comprehensive developer tool ever created, putting that together with the .NET Frameworks' Class Libraries, the developer has everything he or she needs to get up-to-speed on Microsoft's latest revolution in application development. This book will guide the developer through using the VS .NET IDE, the Visual Basic .NET and C# language, and the supporting tools available from Microsoft to create Windows and Web-based applications. The market is full of books that pretty much say the same thing, which is already available in the help files, the author of this book has written and deployed over a dozen successful applications using Visual Studio .NET and the .NET Framework. All of his expertise and experience is used to give you the most comprehensive title on using Visual Studio .NET.