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

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

作者:VB.NET开发    项目:Syste   
' Attempt to assign an out-of-range value to a DateTime constructor.
Dim numberOfTicks As Long = Int64.MaxValue
Dim validDate As Date

' Validate the value.
If numberOfTicks >= Date.MinValue.Ticks And _
   numberOfTicks <= Date.MaxValue.Ticks Then
   validDate = New Date(numberOfTicks)
ElseIf numberOfTicks < Date.MinValue.Ticks Then
   Console.WriteLine("{0:N0} is less than {1:N0} ticks.", 
                     numberOfTicks, 
                     DateTime.MinValue.Ticks)      
Else                                                   
   Console.WriteLine("{0:N0} is greater than {1:N0} ticks.", 
                     numberOfTicks, 
                     DateTime.MaxValue.Ticks)     
End If


问题


面经


文章

微信
公众号

扫码关注公众号