Site 类

定义

定义 IIS 中配置的所有网站的通用属性和方法。

public ref class Site sealed : Microsoft::Web::Administration::ConfigurationElement
public sealed class Site : Microsoft.Web.Administration.ConfigurationElement
type Site = class
    inherit ConfigurationElement
Public NotInheritable Class Site
Inherits ConfigurationElement
继承

注解

网站是 Web 应用程序的容器,可通过一个或多个唯一绑定进行访问。 网站绑定是 IP 地址、端口和可选主机标头的组合。 每个网站必须至少有一个 Web 应用程序。

属性

ApplicationDefaults

获取在当前网站下配置的应用程序的默认值。

Applications

表示当前网站的应用程序的集合。

Attributes

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

(继承自 ConfigurationElement)
Bindings

获取与站点侦听器关联的 IP 地址、TCP 端口和主机标头的集合。

ChildElements

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

(继承自 ConfigurationElement)
ElementTagName

定义 IIS 中配置的所有网站的通用属性和方法。

(继承自 ConfigurationElement)
Id

获取或设置网站的唯一 ID。

IsLocallyStored

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

(继承自 ConfigurationElement)
Item[String]

获取或设置具有指定名称的属性。

(继承自 ConfigurationElement)
Limits

获取网站的连接相关限制。

LogFile

获取可用于为网站配置日志记录的日志文件。

Methods

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

(继承自 ConfigurationElement)
Name

获取或设置网站的名称。

RawAttributes

定义 IIS 中配置的所有网站的通用属性和方法。

(继承自 ConfigurationElement)
Schema

获取当前元素的架构。

(继承自 ConfigurationElement)
ServerAutoStart

获取或设置一个值,该值指示网站服务器是否应在 Windows 启动时自动启动。

State

获取网站的运行状态。

TraceFailedRequestsLogging

获取一个 SiteTraceFailedRequestsLogging 对象,该对象为当前网站上失败的请求配置日志设置。

VirtualDirectoryDefaults

获取未设置显式值时,在当前站点下创建的所有虚拟目录默认将使用的值。

方法

Delete()

定义 IIS 中配置的所有网站的通用属性和方法。

(继承自 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)
GetMetadata(String)

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

(继承自 ConfigurationElement)
GetWebConfiguration()

返回站点的 Web.config 文件中的配置值。

SetAttributeValue(String, Object)

设置所指定特性的值。

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

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

(继承自 ConfigurationElement)
Start()

启动网站,并将 对象的 属性Site设置为 StateStarted

Stop()

停止网站 State 并将 对象的 属性 Site 设置为 Stopped

ToString()

返回站点名称。

适用于