C#中判断数据类型:
int i = 5;
Console.WriteLine( "i is an int? {0}",i.GetType()==typeof(int));
Console.WriteLine( "i is an int? {0}",i.GetType()==typeof(int));
Console.WriteLine( "i is an int? {0}",typeof(int).IsInstanceOfType(i));
C#中判断数据类型:
Console.WriteLine( "i is an int? {0}",typeof(int).IsInstanceOfType(i));
相关文章: