vb System.OverflowException类(方法)实例源码

下面列出了vb System.OverflowException 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:Syste   
Dim value As Integer = 780000000
Try
   ' Square the original value.
   Dim square As Integer = value * value 
   Console.WriteLine("{0} ^ 2 = {1}", value, square)
Catch e As OverflowException
   Dim square As Double = Math.Pow(value, 2)
   Console.WriteLine("Exception: {0} > {1:E}.", _
                     square, Int32.MaxValue)
End Try

作者:VB.NET开发    项目:Syste   
Dim value As Byte = 241
Try
   Dim newValue As SByte = (CSByte(value))
   Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
                     value.GetType().Name, value, _
                     newValue.GetType().Name, newValue)
Catch e As OverflowException
   Console.WriteLine("Exception: {0} > {1}.", value, SByte.MaxValue)
End Try


问题


面经


文章

微信
公众号

扫码关注公众号