다음을 통해 공유


Application.ApplicationPoolName 속성

정의

애플리케이션이 할당된 애플리케이션 풀의 이름을 가져오거나 설정합니다.

public:
 property System::String ^ ApplicationPoolName { System::String ^ get(); void set(System::String ^ value); };
public string ApplicationPoolName { get; set; }
member this.ApplicationPoolName : string with get, set
Public Property ApplicationPoolName As String

속성 값

애플리케이션이 할당된 애플리케이션 풀의 이름입니다.

예제

다음 예제에서는 기존 Application에 대한 구성 설정을 읽습니다. 코드는 "기본 웹 사이트"에 구성된 애플리케이션의 속성에서 ApplicationPoolName 반환된 값을 표시합니다.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class AdministrationApplicationApplicationPoolName
    {
// Writes out the applications and the application pool names 
// associated with the applications under the default Web site.
public void GetApplicationPoolNames()
{
    ServerManager manager = new ServerManager();
    Site defaultSite = manager.Sites["Default Web Site"];

    foreach (Application app in defaultSite.Applications)
    {
        Console.WriteLine(
            "{0} is assigned to the '{1}' application pool.", 
            app.Path, app.ApplicationPoolName);
    }
}
    }
}

다음 예제에서는 새 ApplicationPool 를 만든 다음 새로 만든 ApplicationPool에 할당된 새 애플리케이션을 만듭니다.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class AdministrationApplicationApplicationPoolName
    {
// Creates a new application pool and a new application, then 
// assigns the application to the new application pool.
public void SetApplicationPoolName()
{
    ServerManager manager = new ServerManager();
    Site defaultSite = manager.Sites["Default Web Site"];

    ApplicationPool blogPool = 
        manager.ApplicationPools.Add("BlogApplicationPool");
    Application app = defaultSite.Applications.Add(
        "/blogs", @"C:\inetpub\wwwroot\blogs");
    app.ApplicationPoolName = blogPool.Name;
    manager.CommitChanges();
}
    }
}

설명

각 사이트에는 기본 애플리케이션 풀이 구성되었을 수 있습니다. 애플리케이션 풀이 애플리케이션에 대해 명시적으로 설정되지 않은 경우 속성은 ApplicationPoolName 사이트에 대해 구성된 기본 애플리케이션 풀 이름을 반환합니다. 사용 된 Microsoft.Web.Administration.Site.ApplicationDefaults 사이트에 대 한 기본 설정을 보려면 속성입니다.

적용 대상