Partager via


SPFile.Lock - Méthode

Crée un verrou sur le fichier, empêchant les autres utilisateurs de le modifier.

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

Syntaxe

'Déclaration
Public Sub Lock ( _
    lockType As SPFile.SPLockType, _
    lockId As String, _
    timeout As TimeSpan _
)
'Utilisation
Dim instance As SPFile
Dim lockType As SPFile.SPLockType
Dim lockId As String
Dim timeout As TimeSpan

instance.Lock(lockType, lockId, timeout)
public void Lock(
    SPFile.SPLockType lockType,
    string lockId,
    TimeSpan timeout
)

Paramètres

  • lockId
    Type : System.String

    Un identificateur (ID) pour le verrou.

Exceptions

Exception Condition
SPFileLockException

lockType est None.

Remarques

Vous pouvez déterminer si le fichier est déjà verrouillé en vérifiant la propriété LockType . S'il est None, le fichier n'est pas verrouillé.

Voir aussi

Référence

SPFile classe

SPFile - Membres

Microsoft.SharePoint - Espace de noms

ReleaseLock(String)

RefreshLock(String, TimeSpan)

LockType