关于 取得对象类型的方法

msdn 上给的

 

typeof(类型)

typeof表达式采用以下形式:

System.Type type = typeof(int); 
这样    Type 类型 的变量  type  存储的就是 int
若要获取表达式的运行时类型,可以使用 .NET Framework 方法 GetType,如以下示例中所示:
int i = 0;
System.Type type = i.GetType();

 

posted @ 2013-01-25 11:07  王若伊_恩赐解脱  阅读(139)  评论(0编辑  收藏  举报