从下面给出的示例中,哪一个是专门为 Timer Jobs 在 sharepoint 中引用当前站点/网站的最佳方式,为什么?
示例 1:SPWebApplication webApp = this.Parent as SPWebApplication; SPWeb oWeb = webApp.Sites[0].RootWeb;
或者
示例 2: using(SPSite site=new SPSite(SPPContext.Current.Web.Url)){ using(SPWeb web=site.OpenWeb()){
} }