ConfigurationSectionWithCollection.Clear 메서드
구성 섹션의 컬렉션에서 모든 요소를 지웁니다.
구문
ConfigurationSectionWithCollection.Clear(collectionName);
ConfigurationSectionWithCollection.Clear(collectionName)
매개 변수
이름 | 정의 |
---|---|
collectionName |
string 제거할 컬렉션의 이름을 포함하는 값입니다. |
반환 값
이 메서드는 값을 반환하지 않습니다.
예제
다음 예제에서는 기본 웹 사이트에 대해 상속된 모든 기본 문서를 포함하여 기본 문서를 지웁니다. 이 코드로 인해 기본 웹 사이트의 Web.config 파일 섹션에 다음 XML이 추가 <system.webServer>
됩니다.
<defaultDocument>
<files>
<clear />
</files>
</defaultDocument>
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the default Web site.
Set oSite= oWebAdmin.Get("Site.Name='Default Web Site'")
' Get the default documents section.
oSite.GetSection "DefaultDocumentSection", oDefaultDocumentSection
' Clear the default documents that are listed in the
' DefaultDocumentSection.Files.Files property.
oDefaultDocumentSection.Clear("Files.Files")
요구 사항
형식 | Description |
---|---|
클라이언트 | - Windows Vista의 IIS 7.0 - Windows 7의 IIS 7.5 - Windows 8의 IIS 8.0 - WINDOWS 10 IIS 10.0 |
서버 | - Windows Server 2008의 IIS 7.0 - Windows Server 2008 R2의 IIS 7.5 - Windows Server 2012의 IIS 8.0 - Windows Server 2012 R2의 IIS 8.5 - WINDOWS SERVER 2016 IIS 10.0 |
제품 | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF 파일 | WebAdministration.mof |
참고 항목
ConfigurationSectionWithCollection 클래스
DefaultDocumentSection 클래스
FileSettings 클래스