Application 类

定义

定义 Internet Information Services (IIS) 中的所有应用程序通用的属性。

public ref class Application sealed : Microsoft::Web::Administration::ConfigurationElement
public sealed class Application : Microsoft.Web.Administration.ConfigurationElement
type Application = class
    inherit ConfigurationElement
Public NotInheritable Class Application
Inherits ConfigurationElement
继承

示例

以下示例创建 Web 应用程序。

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

namespace AdministrationSnippets
{
    public class AdministrationApplication
    {
        // Creates an application under the default Web site.
        public void CreateApplication()
        {
            ServerManager manager = new ServerManager();
            Site defaultSite = manager.Sites["Default Web Site"];
            defaultSite.Applications.Add(
                "/blogs", @"C:\inetpub\wwwroot\blogs");
            manager.CommitChanges();
        }
    }
}

注解

应用程序是 IIS 中网站中内容的分组。 应用程序由内容的物理路径和特定于该路径中内容的属性指定。

属性

ApplicationPoolName

获取或设置应用程序分配到的应用程序池的名称。

Attributes

获取包含此元素的属性列表的配置属性集合。

(继承自 ConfigurationElement)
ChildElements

获取当前元素的所有子元素。

(继承自 ConfigurationElement)
ElementTagName

定义 Internet Information Services (IIS) 中的所有应用程序通用的属性。

(继承自 ConfigurationElement)
EnabledProtocols

获取或设置为应用程序启用的协议。

IsLocallyStored

获取一个值,该值指示配置元素是否存储在特定的配置文件中。

(继承自 ConfigurationElement)
Item[String]

获取或设置具有指定名称的属性。

(继承自 ConfigurationElement)
Methods

获取配置元素的方法集合。

(继承自 ConfigurationElement)
Path

获取或设置与应用程序关联的相对值。

RawAttributes

定义 Internet Information Services (IIS) 中的所有应用程序通用的属性。

(继承自 ConfigurationElement)
Schema

获取当前元素的架构。

(继承自 ConfigurationElement)
VirtualDirectories

获取应用程序的虚拟目录集合。

VirtualDirectoryDefaults

获取分配给应用程序的所有虚拟目录的默认值。

方法

Delete()

定义 Internet Information Services (IIS) 中的所有应用程序通用的属性。

(继承自 ConfigurationElement)
GetAttribute(String)

返回一个 ConfigurationAttribute 对象,该对象表示请求的属性。

(继承自 ConfigurationElement)
GetAttributeValue(String)

返回指定特性的值。

(继承自 ConfigurationElement)
GetChildElement(String)

返回当前配置元素下且具有指定名称的子元素。

(继承自 ConfigurationElement)
GetChildElement(String, Type)

返回一个子元素,该子元素位于当前配置元素下,具有指定的名称和类型。

(继承自 ConfigurationElement)
GetCollection()

返回当前配置元素的默认集合。

(继承自 ConfigurationElement)
GetCollection(String)

返回属于当前配置元素的所有配置元素。

(继承自 ConfigurationElement)
GetCollection(String, Type)

返回具有指定名称和类型的配置元素,并且位于当前配置元素下。

(继承自 ConfigurationElement)
GetCollection(Type)

返回具有指定类型且位于当前配置元素下的配置元素。

(继承自 ConfigurationElement)
GetMetadata(String)

从元素架构返回元数据值。

(继承自 ConfigurationElement)
GetWebConfiguration()

返回 Configuration 当前站点和应用程序路径的 对象。

SetAttributeValue(String, Object)

设置所指定特性的值。

(继承自 ConfigurationElement)
SetMetadata(String, Object)

设置元素架构中的元数据值。

(继承自 ConfigurationElement)
ToString()

返回一个字符串,该字符串是站点名称和路径的组合。

适用于