Compartilhar via


SPWebApplicationCollection Class

Represents a collection of SPWebApplication objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPWebApplication>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPWebApplication>
      Microsoft.SharePoint.Administration.SPWebApplicationCollection

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPWebApplicationCollection _
    Inherits SPPersistedChildCollection(Of SPWebApplication)
'Usage
Dim instance As SPWebApplicationCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPWebApplicationCollection : SPPersistedChildCollection<SPWebApplication>

Remarks

Use the WebApplications property of the SPWebService class to return an SPWebApplicationCollection object that represents the collection of Web applications within a Web service. To create a new Web application within the collection, use the SPWebApplicationBuilder class.

Use an indexer to return a single Web application from the collection. For example, if the collection is assigned to a variable named myWebApplications, use myWebApplications[index] in C#, or myWebApplications(index) in Visual Basic, where index is either the name or the GUID identifying the Web application.

Thread Safety

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

See Also

Reference

SPWebApplicationCollection Members

Microsoft.SharePoint.Administration Namespace