VB.Net by API/System/ArithmeticException

Материал из VB Эксперт
Перейти к: навигация, поиск

ArithmeticException.Message

<source lang="vbnet"> Module Module1

   Sub Main()
           Try
               AddNumbers(1, 2)
           Catch Except As Exception
               Console.WriteLine("Call generated error: " & Except.Message)
           End Try
   End Sub
   Function AddNumbers(ByVal A As Integer, ByVal B As Integer) As Integer
       Try
           Throw New ArithmeticException()
       Catch Except As Exception
           Console.WriteLine(Except.Message)
       End Try
   End Function

End Module


 </source>