Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Especifica los nombres de archivo de página web que se van a servir a los clientes de forma predeterminada.
Sintaxis
class DefaultDocumentSection : ConfigurationSectionWithCollection
Métodos
En la tabla siguiente se enumeran los métodos que expone la clase DefaultDocumentSection.
| Nombre | Descripción |
|---|---|
| Add (Agregar) | (Se hereda de ConfigurationSectionWithCollection). |
| Borrar | (Se hereda de ConfigurationSectionWithCollection). |
| Get | (Se hereda de ConfigurationSectionWithCollection). |
| GetAllowDefinition | (Se hereda de ConfigurationSection). |
| GetAllowLocation | (Se hereda de ConfigurationSection). |
| Remove | (Se hereda de ConfigurationSectionWithCollection). |
| RevertToParent | (Se hereda de ConfigurationSection). |
| SetAllowDefinition | (Se hereda de ConfigurationSection). |
| SetAllowLocation | (Se hereda de ConfigurationSection). |
Propiedades
La siguiente tabla enumera las propiedades expuestas por la clase DefaultDocumentSection.
| Nombre | Descripción |
|---|---|
Enabled |
Valor boolean de lectura y escritura. true si los archivos especificados en la propiedad Files se devuelven a los clientes de forma predeterminada; de lo contrario, es false. El valor predeterminado es true. |
Files |
Valor FileSettings que contiene los nombres de los archivos que el servidor web puede devolver a los clientes de forma predeterminada. |
Location |
(Se hereda de ConfigurationSection). Una propiedad de clave. |
Path |
(Se hereda de ConfigurationSection). Una propiedad de clave. |
SectionInformation |
(Se hereda de ConfigurationSection). |
Subclases
Esta clase no contiene subclases.
Comentarios
Esta clase corresponde a la sección <defaultDocument> de ApplicationHost.config.
Ejemplo
En el ejemplo siguiente se enumeran los documentos predeterminados para el sitio web predeterminado.
' Connect to the WMI WebAdministration namespace.
Set objWMIService = GetObject("winmgmts:root\WebAdministration")
' Get the default Web site.
Set oSite = objWMIService.Get("Site.Name='Default Web Site'")
' Retrieve the default document section by using the GetSection method.
oSite.GetSection "DefaultDocumentSection", oDefaultDocumentSection
' List the path and show whether the default document section is enabled.
WScript.Echo "Path: " & oDefaultDocumentSection.Path
WScript.Echo
WScript.Echo "Default Document Section Enabled: " & oDefaultDocumentSection.Enabled
WScript.Echo
' List the default document file names.
WScript.Echo "[Default Document File List]"
For Each oFile In oDefaultDocumentSection.Files.Files
WScript.Echo oFile.Value
Next
Jerarquía de herencia
ConfigurationSectionWithCollection
DefaultDocumentSection
Requisitos
| Tipo | Descripción |
|---|---|
| Remoto | - IIS 7.0 en Windows Vista - IIS 7.5 en Windows 7 - IIS 8.0 en Windows 8 - IIS 10.0 en Windows 10 |
| Server | - IIS 7.0 en Windows Server 2008 - IIS 7.5 en Windows Server 2008 R2 - IIS 8.0 en Windows Server 2012 - IIS 8.5 en Windows Server 2012 R2 - IIS 10.0 en Windows Server 2016 |
| Producto | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
| Archivo MOF | WebAdministration.mof |
Consulte también
Clase ConfigurationSectionWithCollection
Clase FileSettings
Clase de sitio