SPVirtualServer.Sites property
NOTE: This API is now obsolete.
已過時。取得虛擬伺服器上的所有網站集合的集合。
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<ObsoleteAttribute("Use SPWebApplication or SPIisSettings instead.", _
False)> _
Public ReadOnly Property Sites As SPSiteCollection
Get
'用途
Dim instance As SPVirtualServer
Dim value As SPSiteCollection
value = instance.Sites
[ObsoleteAttribute("Use SPWebApplication or SPIisSettings instead.",
false)]
public SPSiteCollection Sites { get; }
Property value
Type: Microsoft.SharePoint.Administration.SPSiteCollection
SPSiteCollection 物件表示之網站集合。
Examples
下列程式碼範例會使用Sites屬性來指定虛擬伺服器的網站集合中建立最上層網站。
Dim globalAdmin As New SPGlobalAdmin()
Dim siteCollections As SPSiteCollection = globalAdmin.VirtualServers(0).Sites
Dim newSPSite As SPSite = siteCollections.Add("sites/Site_Name", _
+ "DOMAIN\User", "Email_Address")
SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
SPSiteCollection siteCollections = globalAdmin.VirtualServers[0].Sites;
SPSite newSPSite = siteCollections.Add("sites/Site_Name",
"DOMAIN\\User", "Email_Address");