Export (0) Print
Expand All

SPFile.Recycle Method

Sends the file to the recycle bin.

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

[ClientCallableMethodAttribute(RemoveThisObjectFromParentCollection = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "3", ErrorType = typeof(SPFileLockException), 
	ErrorCode = , Condition = "There is an exclusive lock on the file")]
[ClientCallableExceptionConstraintAttribute(FixedId = "4", ErrorType = typeof(SPFileLockException), 
	ErrorCode = , Condition = "There is a shared lock on the file")]
[ClientCallableExceptionConstraintAttribute(FixedId = "filenotfound", Condition = "File cannot be found.", 
	ErrorType = typeof(FileNotFoundException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "2", ErrorType = typeof(SPFileCheckOutException), 
	ErrorCode = , Condition = "File is checked out to somebody else")]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", Condition = "Lack of permissions to perform the operation.", 
	ErrorType = typeof(UnauthorizedAccessException))]
public Guid Recycle()

Return Value

Type: System.Guid
A System.Guid object that identifies the file.

Community Additions

ADD
Show:
© 2014 Microsoft