SiteCollection 类

定义

表示 Site 对象集合。

C#
public sealed class SiteCollection : Microsoft.Web.Administration.ConfigurationElementCollectionBase<Microsoft.Web.Administration.Site>
继承

注解

此类是密封的,不实现公共构造函数。 可以通过 类SitesServerManager 属性访问 SiteCollection 类。 SiteCollection 实现 接口, System.Collections.Generic.IEnumerable<T> 并包含 方法的 <xref:Microsoft.Web.Administration.SiteCollection.GetEnumerator%2A> 实现。 Add分别使用 和 Remove 方法创建新网站或删除现有站点。 此外,还可以使用索引器按位置或网站名称获取对集合中项的引用。

属性

AllowsAdd

获取一个值,该值指示元素名称是否 add 在当前集合架构中定义。

(继承自 ConfigurationElementCollectionBase<T>)
AllowsClear

获取一个值,该值指示元素名称是否 clear 在当前集合架构中定义。

(继承自 ConfigurationElementCollectionBase<T>)
AllowsRemove

获取一个值,该值指示元素名称是否 remove 在当前集合架构中定义。

(继承自 ConfigurationElementCollectionBase<T>)
Attributes

获取包含此元素的属性列表的配置属性集合。

(继承自 ConfigurationElement)
ChildElements

获取当前元素的所有子元素。

(继承自 ConfigurationElement)
Count

获取集合中的项数。

(继承自 ConfigurationElementCollectionBase<T>)
ElementTagName

表示 Site 对象集合。

(继承自 ConfigurationElement)
IsLocallyStored

获取一个值,该值指示配置元素是否存储在特定的配置文件中。

(继承自 ConfigurationElement)
Item[Int32]

获取指定索引处的配置元素。

(继承自 ConfigurationElementCollectionBase<T>)
Item[String]

获取集合中具有指定名称的网站。

Methods

获取配置元素的方法集合。

(继承自 ConfigurationElement)
RawAttributes

表示 Site 对象集合。

(继承自 ConfigurationElement)
Schema

获取描述配置元素集合的架构。

(继承自 ConfigurationElementCollectionBase<T>)

方法

Add(String, String, Int32)

使用指定的网站名称、路径和绑定端口将新网站添加到网站集。

Add(String, String, String, Byte[])

使用指定的网站名称、绑定信息、物理文件路径和证书哈希向网站集添加新网站。

Add(String, String, String, Byte[], String)

表示 Site 对象集合。

Add(String, String, String, Byte[], String, SslFlags)

表示 Site 对象集合。

Add(String, String, String, String)

使用指定的参数创建新网站,并将其添加到网站集。

Add(T)

将配置元素添加到当前集合的末尾。

(继承自 ConfigurationElementCollectionBase<T>)
AddAt(Int32, T)

将配置元素添加到当前集合中的指定索引处。

(继承自 ConfigurationElementCollectionBase<T>)
Clear()

清除当前集合中的所有配置元素。

(继承自 ConfigurationElementCollectionBase<T>)
CreateElement()

为当前集合创建新的子元素。

(继承自 ConfigurationElementCollectionBase<T>)
CreateElement(String)

使用指定名称创建新的子元素。

(继承自 ConfigurationElementCollectionBase<T>)
CreateNewElement(String)

使用指定的元素名称创建新元素。

(继承自 ConfigurationElementCollectionBase<T>)
Delete()

表示 Site 对象集合。

(继承自 ConfigurationElement)
GetAttribute(String)

返回一个 ConfigurationAttribute 对象,该对象表示请求的属性。

(继承自 ConfigurationElement)
GetAttributeValue(String)

返回指定特性的值。

(继承自 ConfigurationElement)
GetChildElement(String)

返回当前配置元素下且具有指定名称的子元素。

(继承自 ConfigurationElement)
GetChildElement(String, Type)

返回一个子元素,该子元素位于当前配置元素下,具有指定的名称和类型。

(继承自 ConfigurationElement)
GetCollection()

返回当前配置元素的默认集合。

(继承自 ConfigurationElement)
GetCollection(String)

返回属于当前配置元素的所有配置元素。

(继承自 ConfigurationElement)
GetCollection(String, Type)

返回具有指定名称和类型的配置元素,并且位于当前配置元素下。

(继承自 ConfigurationElement)
GetCollection(Type)

返回具有指定类型且位于当前配置元素下的配置元素。

(继承自 ConfigurationElement)
GetEnumerator()

返回循环访问集合的枚举数。

(继承自 ConfigurationElementCollectionBase<T>)
GetMetadata(String)

从元素架构返回元数据值。

(继承自 ConfigurationElement)
IndexOf(T)

确定集合中元素的索引。

(继承自 ConfigurationElementCollectionBase<T>)
InvalidSiteNameCharacters()

检索不能用于网站名称的字符数组。

Remove(Site)

从网站集中删除指定的网站。

Remove(T)

从集合中删除元素的第一个匹配项。

(继承自 ConfigurationElementCollectionBase<T>)
RemoveAt(Int32)

从网站集中删除位于指定集合索引处的网站。

SetAttributeValue(String, Object)

设置所指定特性的值。

(继承自 ConfigurationElement)
SetMetadata(String, Object)

设置元素架构中的元数据值。

(继承自 ConfigurationElement)

显式接口实现

ICollection.CopyTo(Array, Int32)

从特定的数组索引开始,将集合的元素复制到数组中。

(继承自 ConfigurationElementCollectionBase<T>)
ICollection.Count

表示 Site 对象集合。

(继承自 ConfigurationElementCollectionBase<T>)
ICollection.IsSynchronized

表示 Site 对象集合。

(继承自 ConfigurationElementCollectionBase<T>)
ICollection.SyncRoot

表示 Site 对象集合。

(继承自 ConfigurationElementCollectionBase<T>)
IEnumerable.GetEnumerator()

返回一个循环访问集合的枚举器。

(继承自 ConfigurationElementCollectionBase<T>)

适用于

产品 版本
IIS SDK for .NET latest