SPServiceCollection Class
Represents a collection of SPService objects.
System.Object
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPService>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPService>
Microsoft.SharePoint.Administration.SPServiceCollection
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPService>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPService>
Microsoft.SharePoint.Administration.SPServiceCollection
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Use the Services property of the SPFarm class to return an SPServiceCollection object that represents the collection of services on the server farm. To add a service to the server farm, use the Add method of the SPPersistedChildCollection<T> class.
Use an indexer to return a single service from the collection. For example, if the collection is assigned to a variable named myServices, use myServices[index] in C#, or myServices(index) in Visual Basic, where index is either the GUID or the name that identifies the service.