首页/技术开发/内容

基于.Net的AOP完成技术

技术开发2024-02-29 阅读()
[摘要]Construction"action-position="Both"match="*,*"/> </ Websharp.Asp...
Construction"action-position="Both"match="*,*"/>

</ Websharp.Aspects >

</configuration>


5、 在Main方法中添加如下代码:

public class MainClass

{

[STAThread]

static void Main ()

{

BusinessClass cls=new BusinessClass();

cls.OutputMethod();

cls.GetString();

Console.ReadLine();

}

}


运行以上代码,其结果如下:


可以看到,FirstAspect如我们所预期的那样,成功的拦截了BusinessClass的方法。

第1页  第2页 

……

相关阅读