Share via


servicesCollection.Count property

The Count property gets the number of Service objects in the collection.

This property is read-only.

Syntax

Count = servicesCollection.Count

Property value

The read-only number of Service objects in the collection.

Examples

The following JScript example uses servicesCollection.Count to enumerate a collection of services and access them by index.

// Retrieve a collection of services from the device.
var services = deviceObject.Services;

// Enumerate the services in the collection and access them by index.
for (i=0; i < services.Count; i++)
{
    var aService = services[i]; 
}

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]

See also

servicesCollection Object

Service Object