Uwaga
Dostęp do tej strony wymaga autoryzacji. Może spróbować zalogować się lub zmienić katalogi.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Specifies the Web page file names to serve to clients by default.
class DefaultDocumentSection : ConfigurationSectionWithCollection
The following table lists the methods exposed by the DefaultDocumentSection
class.
Name | Description |
---|---|
Add | (Inherited from ConfigurationSectionWithCollection.) |
Clear | (Inherited from ConfigurationSectionWithCollection .) |
Get | (Inherited from ConfigurationSectionWithCollection .) |
GetAllowDefinition | (Inherited from ConfigurationSection.) |
GetAllowLocation | (Inherited from ConfigurationSection .) |
Remove | (Inherited from ConfigurationSectionWithCollection .) |
RevertToParent | (Inherited from ConfigurationSection .) |
SetAllowDefinition | (Inherited from ConfigurationSection .) |
SetAllowLocation | (Inherited from ConfigurationSection .) |
The following table lists the properties exposed by the DefaultDocumentSection
class.
Name | Description |
---|---|
Enabled |
A read/write boolean value. true if the files specified in the Files property are returned to clients by default; otherwise, false . The default is true . |
Files |
A FileSettings value that contains the names of the files that the Web server may return to clients by default. |
Location |
(Inherited from ConfigurationSection .) A key property. |
Path |
(Inherited from ConfigurationSection .) A key property. |
SectionInformation |
(Inherited from ConfigurationSection .) |
This class contains no subclasses.
This class corresponds to the <defaultDocument>
section in ApplicationHost.config.
The following example lists the default documents for the default Web site.
' 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
ConfigurationSectionWithCollection
DefaultDocumentSection
Type | Description |
---|---|
Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF file | WebAdministration.mof |
ConfigurationSectionWithCollection Class
FileSettings Class
Site Class