/// <summary> /// 是否数值类型 /// </summary> /// <param name="o">欲被测试的对象</param> /// <returns></returns> public static bool IsNumberType(object o) { if (o == null) { return(false); } if (o is ValueType) { return(ValueTypeUnit.IsNumberType(o.GetType())); } return(false); }
/// <summary> /// 是否基本类型 /// </summary> /// <param name="type">类型</param> /// <returns></returns> public static bool IsBasicType(Type type) { return(type == typeof(IPAddress) || ValueTypeUnit.IsDateTime(type) || ValueTypeUnit.IsNumberType(type) || TypeUnit.IsString(type) || ValueTypeUnit.IsFloatType(type)); }