如何在HttpModule中获取当前请求的SPWebApplication?

时间:2011-03-27 12:43:05

标签: sharepoint-2010 httpmodule

如何从HttpModule获取当前请求的SPWebApplication?

2 个答案:

答案 0 :(得分:1)

尝试自己构建SPSite

using(SPSite site = new SPSite(app.Context.Request.Url.ToString())) { //might need to trim the url
    site.WebApplication
}

答案 1 :(得分:0)

尝试SPContext.Current.Site.WebApplication