共用方式為


SPServiceInstanceCollection class

代表SPServiceInstance物件的集合。

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPServiceInstance>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPServiceInstance>
      Microsoft.SharePoint.Administration.SPServiceInstanceCollection

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

Syntax

'宣告
<GuidAttribute("B089C872-3220-43C5-A503-833986C09275")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPServiceInstanceCollection _
    Inherits SPPersistedChildCollection(Of SPServiceInstance)
'用途
Dim instance As SPServiceInstanceCollection
[GuidAttribute("B089C872-3220-43C5-A503-833986C09275")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPServiceInstanceCollection : SPPersistedChildCollection<SPServiceInstance>

備註

若要傳回SPServiceInstanceCollection物件,代表目前在伺服器執行的服務執行個體,請使用ServiceInstancesSPServer類別屬性,或是SPServiceInstanceCollection建構函式。若要傳回SPServiceInstanceDependencyCollection物件,代表依存服務的服務執行個體,請使用SPService類別之Instances屬性。

若要新增至集合中的服務執行個體,使用Add方法。

若要從集合中傳回單一服務執行個體使用索引器。例如,若集合已指派給變數 myServiceInstances,使用myServiceInstances[index]以 C# 或 Visual Basic,其中index是名稱或 GUID 識別的服務執行個體中的myServiceInstances(index) 。

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.

請參閱

參照

SPServiceInstanceCollection members

Microsoft.SharePoint.Administration namespace