1
如何通过定制账户冒充创建SharePoint 2007网站,因此它不会显示登录提示框冒充SharePoint站点与自定义帐户打开
如何通过定制账户冒充创建SharePoint 2007网站,因此它不会显示登录提示框冒充SharePoint站点与自定义帐户打开
使用SPSite构造函数,你传递对象 要获得令牌的用户,使用SPWeb.AllUsers [“userLoginName”]。UserToken
我认为,为了能够获得用户令牌,没有权限获得另一个用户令牌)
例
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//is important that you instantiate your SPSite object within you elevated code
using (SPSite oSite = new SPSite("your site URL"))
{
using (SPWeb oWeb = "your web")
{
//your code to run elevated
}
}
});
詹尼斯感谢您的答复, 在我来说,我不希望SharePoint网站提示输入登录,我的网站是入店匿名用户,所以当我使用“SPWeb.AllUsers冒充[“userLoginName “] .UserToken'它提示登录。如何在没有该登录提示的情况下进行模仿。 在此先感谢 – 2010-06-03 11:59:48
我不明白。当你在代码背后做事时,它会如何提示登录?你在哪里放置代码,你想做什么? – 2010-06-04 07:41:08