Manipulating Files with the File Object

.NET includes a powerful object called System.IO (technically, System and IO are Namespaces, but they behave like objects). Using various properties, methods, and object properties of System.IO, you can do just about anything you can imagine with the file system. In particular, the System.IO.File and System.IO.Directory objects provide you with extensive file and directory (folder) manipulation.

In the following sections, you'll continue to expand the project that you created earlier in this hour. You'll be writing code that manipulates the filenames selected using the Open File Dialog and Save File Dialog controls.

The code you'll write in the following sections is “the real thing.” For instance, the code ...

Get Sams Teach Yourself C#™ in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.