From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

The default response to unhandled exceptions

The default response to unhandled exceptions - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

The default response to unhandled exceptions

- [Narrator] I have an application for demonstrating unhandled exceptions. We'll look at what happens when debugging the application versus what happens when the application is deployed. I have three buttons on this window. The first one opens a file and outputs its content to this text box. The second button attempts to open a nonexistent file and that will cause an exception. And the third button attempts to divide by zero, and that will also cause an exception. Then the code for this is in this Errormaker.vb file. So I've got a function called OpenFile, and another one called WorkwithNumbers, and you can see down here with WorkwithNumbers, it's attempting to divide by zero, and up here, it's less obvious what's going to happen. What I'm doing here is I'm opening a StreamReader, opening the text file, reading the contents, closing the StreamReader, and trying to send the text of the text file back to the calling…

Contents