Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
能够将动态对象转换为未知对象类型的最佳方法是什么。
public abstract class VehicleBase{ }
公共抽象类汽车:VehicleBase {}
公共抽象类卡车:VehicleBase {}
公共抽象类轿车:汽车{}
我需要能够投射可能是汽车、卡车或轿车的动态对象的方法?对此有什么想法吗?
提前致谢!