SPSite siteColl = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
SPUser user = site.Users[@"Domain\administrator"];
SPUserToken userToken = user.UserToken;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//以administrator身份来执行相关功能
});
本文转自生鱼片博客园博客,原文链接:http://www.cnblogs.com/carysun/archive/2008/12/08/1350139.html,如需转载请自行联系原作者