The following works fine in c# (assuming value
is an object
):
if (valu开发者_运维技巧e is DateTime)
What is the equivalent check for VB.NET?
The VB.Net equivalent is
If TypeOf(value) Is DateTime Then
C#
if (value.GetType() is typeof(DateTime)) {}
VB.NET (so the converters tell me)
If value.[GetType]() Is GetType(DateTime) Then
'...
End If
If TypeOf value Is DateTime Then
精彩评论