你的意思是说在运行时得到类实现的接口么?利用反射可以实现这个目的.下面是示例程序,输出Int32所实现的接口:static void Main(string[] args) { Type classType = typeof(Int32); Type[] interfaces = classType.GetInterfaces();
foreach (Type eachType in interfaces) {
Console.WriteLine(eachType.ToString());
}
温馨提示:内容为网友见解,仅供参考