VB.Net by API/System/FormatException — различия между версиями

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

Версия 19:40, 26 мая 2010

FormatException.Message

<source lang="vbnet">

Public Class Tester

   Public Shared Sub Main
   
     Try
        Dim numerator As Integer = Convert.ToInt32("123")
        Dim denominator As Integer = Convert.ToInt32("321")
        Dim result As Integer = numerator \ denominator
        Console.WriteLine(result)
     Catch formattingException As FormatException
        Console.WriteLine("You must enter two integers")
     Catch dividingException As DivideByZeroException
        Console.WriteLine(dividingException.Message)
     End Try
   End Sub

End Class


 </source>