SPFile.LockedByUser Property

Gets the user who has locked the file.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.Custom, Value = "MUST return null if there is no lock.", 
	FixedId = "1")]
public SPUser LockedByUser { get; }

Property Value

Type: Microsoft.SharePoint.SPUser
The user who owns the lock on the file. If the file is not locked, the value is a null reference (Nothing in Visual Basic).
Show: