更新时间:2023-11-29 09:51:28
不,你不能。 C#不实施鸭式打字。
No, you cannot. C# does not implement duck typing.
你必须实现一个接口并强制转换它。
You must implement an interface and cast to it.
(但是有尝试这样做,看看 Duck Typing Project 。)
(However there are attempts to do it. Look at Duck Typing Project for an example.)