C#中判断数据类型


C#中判断数据类型:

 

int   i   =   5
Console.WriteLine( "i is an int? {0}",i.GetType()==typeof(int)); 

 

Console.WriteLine( "i is an int? {0}",typeof(int).IsInstanceOfType(i)); 


posted @ 2011-12-14 18:33  唔愛吃蘋果  阅读(4171)  评论(0编辑  收藏  举报