VirtualDirectory.RevertToParent 메서드2
가상 디렉터리의 구성 값 또는 값을 기본값으로 되돌려 놓습니다.
구문
VirtualDirectory.RevertToParent(PropertyName)
VirtualDirectory.RevertToParent(PropertyName);
매개 변수
속성 | Description |
---|---|
PropertyName |
Application 클래스의 속성으로 노출되는 VirtualDirectoryElementDefaults 클래스에 지정된 기본값으로 되돌리기 가상 디렉터리 속성의 VirtualDirectoryDefaults 이름을 포함하는 선택적 string 값입니다. |
반환 값
이 메서드는 값을 반환하지 않습니다.
설명
매개 변수 없이 메서드를 RevertToParent
호출하면 가상 디렉터리에 대한 모든 사용자 지정 구성 값이 제거됩니다. 원하는 동작이 아닌 경우 메서드에 매개 변수가 있는 호출을 사용하여 특정 속성을 되돌리기.
예제
다음 예제에서는 가상 디렉터리의 속성을 MyVDir
의 현재 값에서 기본값 true
false
으로 되돌 AllowSubDirConfig
려 줍니다.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject( _
"winmgmts:root\WebAdministration")
' Assign the virtual directory instances to a variable.
Set oVDirs = oWebAdmin.InstancesOf("VirtualDirectory")
' Retrieve the MyVDir virtual directory.
For Each oVDir In oVDirs
If oVDir.Path = "/MyVDir" Then
' Display the virtual directory path.
WScript.Echo "Virtual Path: " & oVDir.Path
' Display the current value.
WScript.Echo "AllowSubDirConfig before revert: " & _
oVDir.AllowSubDirConfig
' Revert the AllowSubDirConfig property.
oVdir.RevertToParent("AllowSubDirConfig")
' Refresh the oVdir object variable.
oVdir.Refresh_
' Display the changed value.
WScript.Echo "AllowSubDirConfig after revert: " & _
oVDir.AllowSubDirConfig
' Exit the loop.
Exit For
End If
Next
' Output:
' Virtual Path: /MyVDir
' AllowSubDirConfig before revert: False
' AllowSubDirConfig after revert: True
요구 사항
형식 | 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 |
참고 항목
애플리케이션 클래스
VirtualDirectory 클래스
VirtualDirectoryElementDefaults 클래스