This documentation is archived and is not being maintained.

Item(Int32) Property

SharePoint 2003

The Item property of the SPFileCollection class gets the file object at the specified index in the collection.

[C#] In C#, this property is an indexer for the SPFileCollection class.


iIndex   A 32-bit integer that specifies the index of the file.

Property Value

A Microsoft.SharePoint.SPFile object that represents the file.


The Item property throws an ArgumentOutOfRangeException if the specified index is outside the valid range of indices for the collection.


The following code example uses the indexer to display the name and author of every file in a Shared Documents document library.

This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint, Microsoft.SharePoint.Utilities, and Microsoft.SharePoint.WebControls namespaces.

The example assumes the existence of a .aspx page that contains a label control.


Platforms: Microsoft Windows Server 2003

Security: Code Access Security