DefaultDocumentSection Class1
Especifica os nomes de arquivos de páginas da Web para servir aos clientes por padrão.
Sintaxe
class DefaultDocumentSection : ConfigurationSectionWithCollection
Métodos
A tabela a seguir lista os métodos expostos pela classe DefaultDocumentSection
.
Nome | Descrição |
---|---|
Add | (Herdado de ConfigurationSectionWithCollection.) |
Limpar | (Herdado de ConfigurationSectionWithCollection .) |
Get | (Herdado de ConfigurationSectionWithCollection .) |
GetAllowDefinition | (Herdado de ConfigurationSection.) |
GetAllowLocation | (Herdado de ConfigurationSection .) |
Remover | (Herdado de ConfigurationSectionWithCollection .) |
RevertToParent | (Herdado de ConfigurationSection .) |
SetAllowDefinition | (Herdado de ConfigurationSection .) |
SetAllowLocation | (Herdado de ConfigurationSection .) |
Propriedades
A tabela a seguir lista as propriedades expostas pela classe DefaultDocumentSection
.
Nome | Descrição |
---|---|
Enabled |
Um valor boolean de leitura/gravação. true se os arquivos especificados na propriedade Files forem retornados aos clientes por padrão, caso contrário, false . O padrão é true . |
Files |
Um valor FileSettings que contém os nomes dos arquivos que o servidor Web pode retornar aos clientes por padrão. |
Location |
(Herdado de ConfigurationSection .) Uma propriedade chave. |
Path |
(Herdado de ConfigurationSection .) Uma propriedade chave. |
SectionInformation |
(Herdado de ConfigurationSection .) |
Subclasses
Essa classe não contém subclasses.
Comentários
Esta classe corresponde à seção <defaultDocument>
em ApplicationHost.config.
Exemplo
O exemplo a seguir lista os documentos padrão para o site da Web padrão.
' 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
Hierarquia de herança
ConfigurationSectionWithCollection
DefaultDocumentSection
Requisitos
Tipo | Descrição |
---|---|
Cliente | – IIS 7.0 no Windows Vista – IIS 7.5 no Windows 7 – IIS 8.0 no Windows 8 – IIS 10.0 no Windows 10 |
Servidor | – IIS 7.0 no Windows Server 2008 – IIS 7.5 no Windows Server 2008 R2 – IIS 8.0 no Windows Server 2012 – IIS 8.5 no Windows Server 2012 R2 – IIS 10.0 no Windows Server 2016 |
Product | – IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
Arquivo MOF | WebAdministration.mof |
Confira também
Classe ConfigurationSectionWithCollection
Classe FileSettings
Classe de Site