找遍Web.Config,Machine.Config,没有找到配置DefaultAuthentication Module 的地方,反射代码一看,原来是在代码中写死的:
这个Module还有个事件的:
可是代码中写死实例化DefaultAuthentication Module,并没有指定此事件要做什么,谁来指定此事件要做什么呢,又在哪里指定呢?
查阅资料:
是在Global.asax中指定的:
通过在应用程序的 Global.asax 文件中指定一个名为 DefaultAuthentication_OnAuthenticate 的子例程可以访问 DefaultAuthenticationModule 类的 Authenticate 事件。
Global.asax中指定了,怎么对应到这个Module的这个实例上呢?
在HttpApplication的InitInternal函数里,通过调用HookupEventHandlersForAppplicationAndModules,用反射的方式挂载进去的:
分析结束。