以下应该工作public static class MyClass{ public static void MyMethod<T>(T t) where T : class { t.ToString(); // Note: for this to work we need to KNOW the type which defines `method`. }}还有这个:public class MyBase{ void Method();}public static class MyClassForBase{ public static void MyMethod<T>(T t) where T : MyBase { t.Method(); // Note: anything from MyBase is now available }}最后但并非最不重要的一点是,您可以像这样使用后期绑定public static class MyClassDynamic{ public static void MyMethod(dynamic t) { t.Method(); // Note: if t doesn't have a `Method` defined, the code will crush-n-burn at runtime }}