HandlersSection 클래스
URL에 대한 처리기를 저장합니다.
구문
class HandlersSection : ConfigurationSectionWithCollection
메서드
다음 표에서는 클래스에 의해 노출되는 메서드를 나열합니다 HandlersSection
.
속성 | 설명 |
---|---|
추가 | ConfigurationSectionWithCollection에서 상속됩니다. |
지우기 | ConfigurationSectionWithCollection 에서 상속됩니다. |
가져오기 | ConfigurationSectionWithCollection 에서 상속됩니다. |
GetAllowDefinition | ( ConfigurationSection에서 상속됩니다.) |
GetAllowLocation | ConfigurationSection 에서 상속됩니다. |
제거 | ConfigurationSectionWithCollection 에서 상속됩니다. |
RevertToParent | ConfigurationSection 에서 상속됩니다. |
SetAllowDefinition | ConfigurationSection 에서 상속됩니다. |
SetAllowLocation | ConfigurationSection 에서 상속됩니다. |
속성
다음 표에서는 클래스에 의해 노출되는 속성을 나열합니다 HandlersSection
.
속성 | Description |
---|---|
AccessPolicy |
sint32 처리기에 대한 액세스 정책을 지정하는 입니다. 가능한 값은 설명 섹션의 뒷부분에 나와 있습니다. |
Handlers |
HandlerAction 개체의 배열입니다. |
Location |
(에서 ConfigurationSection 상속됨) 키 속성입니다. |
Path |
(에서 ConfigurationSection 상속됨) 키 속성입니다. |
SectionInformation |
ConfigurationSection 에서 상속됩니다. |
를 서브클래싱합니다.
이 클래스에는 서브클래스가 없습니다.
설명
이 클래스는 <handlers>
ApplicationHost.config 파일의 섹션에 해당합니다.
다음 표에서는 속성에 사용할 수 있는 값을 나열합니다 AccessPolicy
. 기본값은 1(Read
)입니다.
값 | 키워드 | Description |
---|---|---|
0 | None |
처리기는 권한이 허용되지 않습니다. |
1 | Read |
처리기는 폴더의 파일 또는 콘텐츠에 대한 읽기 권한이 허용됩니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessRead 되었습니다. |
2 | Write |
처리기는 서버의 사용 가능한 디렉터리에 쓰거나 쓰기 사용 파일의 콘텐츠를 변경할 수 있습니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessWrite 되었습니다. |
4 | Execute |
처리기는 파일 형식에 관계없이 폴더의 파일 또는 콘텐츠를 실행할 수 있습니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessExecute 되었습니다. |
16 | Source |
또는 Write 플래그도 설정된 경우 처리기는 스크립트 소스 코드에 Read 액세스할 수 있습니다. 가 설정된 경우 Read 처리기는 소스 코드를 읽을 수 있습니다. 가 설정된 경우 Write 처리기는 소스 코드에 쓸 수 있습니다. Source 도 Write 설정되지 않은 경우 Read 플래그를 사용할 수 없습니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessSource 되었습니다. |
512 | Script |
처리기는 스크립트를 실행할 수 있습니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessScript 되었습니다. |
1024 | NoRemoteWrite |
처리기는 원격으로 작성할 수 없습니다. 파일을 만들거나 변경하는 원격 요청이 거부됩니다. Write 플래그도 설정되면 IIS 웹 서버를 실행하는 컴퓨터의 요청만 성공합니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessNoRemoteWrite 되었습니다. |
4096 | NoRemoteRead |
처리기는 원격으로 읽을 수 없습니다. 파일 보기에 대한 원격 요청이 거부됩니다. Read 플래그도 설정되면 IIS 웹 서버를 실행하는 컴퓨터의 요청만 성공합니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessNoRemoteRead 되었습니다. |
8192 | NoRemoteExecute |
처리기는 원격으로 실행할 수 없습니다. 애플리케이션을 실행하는 원격 요청이 거부됩니다. Execute 플래그도 설정되면 IIS 웹 서버를 실행하는 컴퓨터의 요청만 성공합니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessNoRemoteExecute 되었습니다. |
16384 | NoRemoteScript |
처리기는 원격으로 스크립트를 실행할 수 없습니다. 동적 콘텐츠를 실행하기 위한 원격 요청이 거부됩니다. Script 플래그도 설정되면 IIS 웹 서버를 실행하는 컴퓨터의 요청만 성공합니다. 참고: 이 플래그의 이름은 IIS 6.0에서 지정 AccessNoRemoteScript 되었습니다. |
예제
다음 예제에서는 섹션에서 처리기를 추가하고 제거합니다 <handlers>
.
참고
구성 요소를 추가하거나 제거하면 기본 구성 섹션이 변경되지만 구성 섹션을 나타내는 스크립트의 개체 변수는 변경되지 않습니다. 변경 내용이 스크립트에 표시되도록 하려면 변경한 후 개체 변수에서 WMI Refresh_
메서드를 호출해야 합니다. 그러면 구성 저장소의 최신 데이터로 개체 변수가 업데이트됩니다.
' ----------------------------------------------------------
' The first example adds a handler to the <handlers> section.
' ----------------------------------------------------------
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the <handlers> section.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "HandlersSection", oHandlersSection
' Display the old handler names.
WScript.Echo "---[Old Handler List]---"
Call DisplayHandlers
' Create a new handler.
Set oHandler = oWebAdmin.Get("HandlerAction").SpawnInstance_
oHandler.Name = "NewHandler"
oHandler.Path="*.stm"
oHandler.Verb="GET,POST"
oHandler.Modules="ServerSideIncludeModule"
' Add the handler to the <handlers> section.
oHandlersSection.Add "Handlers", oHandler
' Call the WMI Refresh_ method to update the oHandlersSection object.
oHandlersSection.Refresh_
' Display the new handler names.
WScript.Echo "---[New Handler List]---"
Call DisplayHandlers
' ----------------------------------------------------------------
' The second example removes a handler by using the handler name.
' ----------------------------------------------------------------
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the <handlers> section.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "HandlersSection", oHandlersSection
' Display the old handler names.
WScript.Echo "---[Old Handler List]---"
Call DisplayHandlers
' Remove the CGI-exe handler by name.
For Each oHandler In oHandlersSection.Handlers
If oHandler.Name = "CGI-exe" Then
oHandlersSection.Remove "Handlers", oHandler
End If
Next
' Call the WMI Refresh_ method to update the oHandlersSection object.
oHandlersSection.Refresh_
' Display the new list of handler names.
WScript.Echo "---[New Handler List]---"
Call DisplayHandlers
' This is the sub that displays the handler names.
Sub DisplayHandlers
WScript.Echo
For Each oHandler In oHandlersSection.Handlers
WScript.Echo "Handler Name: " & oHandler.Name
Next
End Sub
상속 계층 구조
ConfigurationSectionWithCollection
HandlersSection
요구 사항
형식 | 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 |