You are here

What are exceptions in C#?

Exception refers to the situations when something unexpected happens to our application. To understand exceptions, let us consider a simple example. Imagine that we have an application that reads data from a file. The file is stored on the computer's hard disk. Everything works fine until the day when someone deletes the file, without our knowledge. Now, when the application tries to read the data, it will not find the required file. This will result in an error and may cause our application to break down. Such situations are known as Exceptions. If we do not take preventive actions, exceptions can be a very unpleasant experience for the users. The application will crash without showing any meaningful message to the user.

source: edimax.com

Forums: