开发者

How to determine if an object is a DateTime in VB.NET

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜