Tag: 任何东西

为什么我不能检查'DateTime'是否为'Nothing'?

在VB.NET中,有没有办法将DateTimevariables设置为“not set”? 为什么可以将DateTime设置为Nothing ,但不可能检查它是否为Nothing ? 例如: Dim d As DateTime = Nothing Dim boolNotSet As Boolean = d Is Nothing 第二个语句抛出这个错误: 'Is' operator does not accept operands of type 'Date'. Operands must be reference or nullable types.