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.
我想拦截一个方法调用(通常是 .net API)。
如何实现这一目标?
我通过一些谷歌搜索看到了 AOP/ContextBoundObject,但所有这些都需要从 ContextBoundObject 派生类。
我想拦截我无法修改的 MessageBox.Show。
我知道的唯一方法是使用运行时编织。在 .NET 中,我熟悉的唯一项目是CTru ,它建立在名为 Typemock Isolator 的商业产品之上(我曾经在那里工作过)