FormatException.Message : FormatException « System « VB.Net by API






FormatException.Message

  
 
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

   
    
  








Related examples in the same category