O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Exception Handling

The following sections work through a series of examples, adding increasingly complex error-handling features to the sample code you've seen already. Starting with a scenario in which you've added no exception handling code at all, these examples introduce the concepts of trapping and identifying exceptions.

TIP

We'll use the terms exception handling and error handling to mean the same thing—that is, code you add to a procedure so that it can manage runtime errors as they occur.

All the examples use the same basic premise: Your goal is to open a file, retrieve its length, and then close the file. Each example uses this code to do its job, retrieving the filename from a text box (txtFileName) on the sample form named ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required