VirtualDirectory.Create Method1
가상 디렉터리를 만듭니다.
구문
objAppSrv.Get("VirtualDirectory").Create(
VirtualDirectoryPath,
ApplicationPath,
PhysicalPath,
SiteName
);
objAppSrv.Get("VirtualDirectory").Create(
VirtualDirectoryPath,
ApplicationPath,
PhysicalPath,
SiteName
)
매개 변수
속성 | Description |
---|---|
VirtualDirectoryPath |
string 가상 디렉터리 경로(예: "/MyVDir")를 포함하는 값입니다. |
ApplicationPath |
string 애플리케이션 경로(예: "/MyApp")를 포함하는 값입니다. |
PhysicalPath |
가상 디렉터리의 콘텐츠가 저장되는 파일 디렉터리에 대한 물리적 경로를 포함하는 선택적 string 값입니다(예: "C:\inetpub\MyVDirFiles"). 이 매개 변수는 선택 사항이지만 대부분의 구현에는 이 매개 변수가 필요합니다. 참고: IIS는 지정된 물리적 디렉터리의 존재에 대해 검사 않습니다. 잘못된 경로를 지정하고 IIS 관리자에서 가상 디렉터리를 열려고 하면 IIS 관리자에 "경로 'path>'<의 일부를 찾을 수 없습니다."라는 오류 메시지가 표시됩니다. |
SiteName |
string 가상 디렉터리의 웹 사이트 이름(예: "기본 웹 사이트")이 들어 있는 값입니다. |
반환 값
이 메서드는 값을 반환하지 않습니다.
설명
개체는 VirtualDirectory
ConfiguredObject 클래스에서 상속되며 VirtualDirectoryElementDefaults 클래스에서 상속되지 않습니다. 즉, 개체의 VirtualDirectoryElementDefaults
속성도 개체에 VirtualDirectory
선언되어야 합니다.
예제
다음 예제에서는 기본 웹 사이트의 애플리케이션 아래에 MyApp
라는 MyVDir
가상 디렉터리를 만듭니다.
' Connect to the WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Define the parameters.
strVDirPath = "/MyVDir"
strAppPath = "/MyApp"
strPhysicalPath = "C:\inetpub\MyVDirFiles"
strSiteName = "Default Web Site"
' Create the new virtual directory.
oWebAdmin.Get("VirtualDirectory").Create _
strVDirPath, strAppPath, strPhysicalPath, strSiteName
요구 사항
형식 | 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 클래스
VirtualDirectoryContainsConfigurationSection 클래스