How to Read and Write a File

A File must be opened using an IO resource before it can be read or write to. A file can be opened to read and/or write purpose. The FileInfo class provides four methods to open a file.

+ Open
+ OpenRead
+ OpenText
+ OpenWrite