VB.Net by API/System/DivideByZeroException — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:40, 26 мая 2010
DivideByZeroException.Message
Imports System.IO
public class Tester
public Shared Sub Main
Dim y As Integer
Dim x As Integer
Dim z As Integer
Try
x = 1
y = 0
z = x / y
Catch e As DivideByZeroException
Console.WriteLine("You have attempted to divide by zero!")
y = 2
z = x / y
Catch e As OverflowException
Console.WriteLine("You have encountered an overflow exception. ")
y = 2
z = x / y
Catch e As System.Data.ConstraintException
Console.WriteLine("You have encountered a constraint exception. ")
y = 2
z = x / y
Finally
Console.WriteLine(x & "/" & y & " = " & z)
End Try
End Sub
End class