About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

The File Class

Alongside the FileInfo class, the System.IO namespace provides a home for a static class called File. Whereas one usually uses a FileInfo to pass around information about a file as an object, the File class provides a series of static methods that expose file system functionality. In fact, some of FileInfo’s instance methods simply call into some of the static methods provided on file.

A first set of methods that deal with files on a wholesale basis is omitted from our discussion here because we’ve seen similar methods like Delete on FileInfo. Instead, we focus on methods that provide access to the contents of a file, which brings us to the concept of readers and writers quite directly.

Note: Directory Versus DirectoryInfo

As ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required