Mega Code Archive

 
Categories / VB.Net Tutorial / Development
 

Inherits System ApplicationException

Imports System.Runtime.Serialization public class Test    public Shared Sub Main         Try             Throw New MyException("This is my Exception.")         Catch ex As Exception             Console.WriteLine(ex.Message)         End Try    End Sub End class Public Class MyException     Inherits System.ApplicationException     Public Sub New()         MyBase.New("This object has expired")     End Sub     Public Sub New(ByVal new_message As String)         MyBase.New(new_message)     End Sub     Public Sub New(ByVal new_message As String, ByVal inner_exception As Exception)         MyBase.New(new_message, inner_exception)     End Sub     Public Sub New(ByVal info As SerializationInfo, _     ByVal context As StreamingContext)         MyBase.New(info, context)     End Sub End Class This is my Exception.