Partager via


SPSite.WriteLocked - Propriété

Gets or sets a Boolean value that specifies whether the site collection is locked and unavailable for Write access.

Espace de noms :  Microsoft.SharePoint
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
Public Property WriteLocked As Boolean
    Get
    Set
'Utilisation
Dim instance As SPSite
Dim value As Boolean

value = instance.WriteLocked

instance.WriteLocked = value
public bool WriteLocked { get; set; }

Valeur de propriété

Type : System.Boolean
true if the site collection is locked for Write access; otherwise, false.

Remarques

Getting the value of the WriteLocked property requires site collection administrator rights, while setting the value requires global administrator rights.

This lock is enforced as if the site were permanently over its storage quota limit. Content can be deleted or reduced in size, but it cannot be increased until the lock is removed.

Setting ReadOnly to true or false also sets WriteLocked to the same value.

WriteLocked returns true whenever the IsReadOnly property of the parent SPDatabase object is true.

Exemples

The following code example applies a lock on writing, but not on reading, to a site collection.

Using oSiteCollection As New SPSite("http://Site_Name")
    oSiteCollection.WriteLocked = True
    oSiteCollection.ReadLocked = False
    oSiteCollection.LockIssue = "Customer did not pay bill."
End Using
using (SPSite oSiteCollection = new SPSite("http://Site_Name"))
{
    oSiteCollection.WriteLocked = true;
    oSiteCollection.ReadLocked  = false;
    oSiteCollection.LockIssue   = "Customer did not pay bill.";
}

Notes

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

Voir aussi

Référence

SPSite classe

SPSite - Membres

Microsoft.SharePoint - Espace de noms