Basic Error Handling Dim f As IO.File Try 'this will cause a file not found error to be thrown. f.Open("D:\fileDoesNotExistFile.txt", IO.FileMode.Open) Catch exc As Exception 'This will give a description of the error. MessageBox.Show(exc.Message, " Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
|