Throw an Exception : Throw « Language Basics « VB.Net






Throw an Exception

Throw an Exception
Imports System
Imports System.Configuration
Imports System.Resources ' Resource readers

Public Class MainClass
    
    Shared Sub Main()
       Throw New System.IO.FileLoadException()
    End Sub
End Class




           
       








Related examples in the same category

1.Catch and rethrow exceptionsCatch and rethrow exceptions
2.Throws exception and catches it locallyThrows exception and catches it locally
3.Throw Exception Without CatchThrow Exception Without Catch
4.Exception occurs and caught, then rethrown to callerException occurs and caught, then rethrown to caller
5.Any Exception generatesd will be caught in the Catch block that followsAny Exception generatesd will be caught in the Catch block that follows
6.Throw an Exception from a FunctionThrow an Exception from a Function