VB.Net by API/System/ArithmeticException

Материал из VB Эксперт
Версия от 15:51, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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>