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
lockType
Type : Microsoft.SharePoint.SPFile.SPLockTypeUne des valeurs d'énumération qui décrit le type de verrou.
lockId
Type : System.StringUn identificateur (ID) pour le verrou.
timeout
Type : System.TimeSpanLa durée du 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é.