SPWebApplicationCollection Class
Represents a collection of SPWebApplication objects.
System.Object
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPWebApplication>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPWebApplication>
Microsoft.SharePoint.Administration.SPWebApplicationCollection
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPWebApplication>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPWebApplication>
Microsoft.SharePoint.Administration.SPWebApplicationCollection
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
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.