SPUser
user = SPContext.Current.Web.CurrentUser; //NOTE: The account which runs the application pool needs to be a farm administratorSPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite("Your Site Utl"))
{
site.WebApplication.FormDigestSettings.Enabled = false;
site.AllowUnsafeUpdates = true;
site.WriteLocked = false;
site.ReadOnly = false;
site.LockIssue = "The site was disabled by: " + user.Name + " (e-mail: " + user.Email + ")";
site.ReadLocked = true;
}
});
1 Komentar
Hi alon.
BalasThanks for the detailed explainantion. But i am checking thro object model is it possible to set the Readonly property to false(Assumption site has been locked)