共用方式為


SPFileVersionCollection.DeleteAll Method

Deletes all the file version objects in the collection.

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

Syntax

'Declaration
<ClientCallableExceptionConstraintAttribute(FixedId := "2", ErrorType := GetType(DirectoryNotFoundException),  _
    Condition := "The specified file version is invalid.")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "3", ErrorType := GetType(UnauthorizedAccessException),  _
    Condition := "Lack of permissions to perform the operation")> _
<ClientCallableAttribute> _
<ClientCallableExceptionConstraintAttribute(FixedId := "1", ErrorType := GetType(SPException),  _
    ErrorCode := , Condition := "The specified file URL is invalid.")> _
Public Sub DeleteAll
'Usage
Dim instance As SPFileVersionCollection

instance.DeleteAll()
[ClientCallableExceptionConstraintAttribute(FixedId = "2", ErrorType = typeof(DirectoryNotFoundException), 
    Condition = "The specified file version is invalid.")]
[ClientCallableExceptionConstraintAttribute(FixedId = "3", ErrorType = typeof(UnauthorizedAccessException), 
    Condition = "Lack of permissions to perform the operation")]
[ClientCallableAttribute]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", ErrorType = typeof(SPException), 
    ErrorCode = , Condition = "The specified file URL is invalid.")]
public void DeleteAll()

Remarks

This method clears the file version information from the collection.

See Also

Reference

SPFileVersionCollection Class

SPFileVersionCollection Members

Microsoft.SharePoint Namespace