11 Exception Handling and Input/Output
11.2 Text File Input and Output
In this chapter we explore exceptions and input and output in C#. Exception handling enables us to manage serious errors that might occur such as trying to read from a file that does not exist. It is essential for implementing input and output operations and networking, in which errors beyond the control of the programmer may easily occur.
After we discuss exception handling, we show how to read from and write to external files. Files persist after our program is finished, keeping data for later use. Business applications, and many others, are heavily dependent on good access to external data. ...
Get Computing with C# and the .NET Framework, 2nd Edition 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.