This documentation is archived and is not being maintained.

SPUserStorage Class

Windows SharePoint Services 3

Maintains information about the user of a Web Part Page and the amount of space the user is consuming in bytes.


Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class SPUserStorage

This class serves two purposes in managing Web Part personalizations:

  • Provides information about the amount of memory consumed by the personalizations of a user.

  • Reduces the amount of space used on the server because the UserId property for a user-storage object can be passed as the parameter in the DeleteAllPersonalizations method of the SPFile class when deleting the personalizations for a particular user.

Use the LengthByUser property of the SPFile class to return an SPUserStorageCollection object that contains information about each user of a Web Part Page. Use an indexer to return a single user-storage object from the collection. For example, if the collection is assigned to a variable named myUserStorages, use myUserStorages[index] in C#, or myUserStorages(index) in Microsoft Visual Basic, where index is the index number of the user storage in the collection. You can also use a foreach statement (For Each in Visual Basic) to iterate through the collection and return the user storage objects.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.