C#中可以利用反射解决,其代码如下:
class Judge
{
public static IsICollection(object o)
{
Type type = typeof(o);
Type t = type.GetInterface("ICollection", false);
if (object.Equals(type, null))
{
return false;
}
else
{
return true;
}
}
}
C#中可以利用反射解决,其代码如下:
class Judge
{
public static IsICollection(object o)
{
Type type = typeof(o);
Type t = type.GetInterface("ICollection", false);
if (object.Equals(type, null))
{
return false;
}
else
{
return true;
}
}
}
1122
1319
787

被折叠的 条评论
为什么被折叠?