SPWebCollection class
代表SPWeb物件的集合。
Inheritance hierarchy
System.Object
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.SPBaseCollection
Microsoft.SharePoint.SPWebCollection
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Class SPWebCollection _
Inherits SPBaseCollection _
Implements IEnumerable(Of SPWeb), IEnumerable
'用途
Dim instance As SPWebCollection
public class SPWebCollection : SPBaseCollection,
IEnumerable<SPWeb>, IEnumerable
備註
使用SPWeb類別之Webs屬性可傳回AllWebsSPSite類別屬性可傳回所有網站集合內網站,或其中一個GetSubwebsForCurrentUser方法SPWeb類別來傳回目前使用者的所有子網站的網站下的所有子網站。
若要從集合中傳回單一網站中使用索引器。例如,若集合已指派給變數collWebSites,使用以 C# collWebSites[index]或Visual Basic,在collWebSites(index)index所在的網站集合、 網站,或 GUID 的顯示名稱之網站集合中的索引編號。
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.