使用方法 GetType()(被 Object
基类的所有子类型继承)以获取变量类型:
using System;
using System.Reflection;
// Using GetType to obtain type information:
int i = 42;
Type type = i.GetType();
Console.WriteLine(type);
//输出:System.Int32
原创文章,作者:huoxiaoqiang,如若转载,请注明出处:https://www.huoxiaoqiang.com/experience/csharpe/7919.html