ApplicationCollection 類別

定義

表示 物件的 物件 Site 集合 Application

public ref class ApplicationCollection sealed : Microsoft::Web::Administration::ConfigurationElementCollectionBase<Microsoft::Web::Administration::Application ^>
public sealed class ApplicationCollection : Microsoft.Web.Administration.ConfigurationElementCollectionBase<Microsoft.Web.Administration.Application>
type ApplicationCollection = class
    inherit ConfigurationElementCollectionBase<Application>
Public NotInheritable Class ApplicationCollection
Inherits ConfigurationElementCollectionBase(Of Application)
繼承

範例

下列範例會顯示預設網站物件中的所有 ApplicationCollection 應用程式。

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

namespace AdministrationSnippets
{
    public class AdministrationApplicationCollection
    {
// Displays all Applications under the "Default Web Site"
public void GetApplications()
{
    ServerManager manager = new ServerManager();
    Site defaultSite = manager.Sites["Default Web Site"];

    foreach (Application app in defaultSite.Applications)
    {
        Console.WriteLine("Found an application: {0}", app.Path);
    }
}
    }
}

備註

這個類別是密封的,而且不會實作公用建構函式。 您可以透過 Applications 類別的 Site 屬性存取 ApplicationCollection 類別。

ApplicationCollection 會實作 IEnumerable<T> 介面。 Add使用 方法來建立新的應用程式。 此外,您可以使用索引子,依位置或應用程式名稱取得集合中專案的參考。

屬性

AllowsAdd

取得值,指出專案名稱是否 add 定義在目前的集合架構中。

(繼承來源 ConfigurationElementCollectionBase<T>)
AllowsClear

取得值,指出專案名稱是否 clear 定義在目前的集合架構中。

(繼承來源 ConfigurationElementCollectionBase<T>)
AllowsRemove

取得值,指出專案名稱是否 remove 定義在目前的集合架構中。

(繼承來源 ConfigurationElementCollectionBase<T>)
Attributes

取得組態屬性集合,其中包含這個專案的屬性清單。

(繼承來源 ConfigurationElement)
ChildElements

取得目前專案的所有子專案。

(繼承來源 ConfigurationElement)
Count

取得集合中的項目數目。

(繼承來源 ConfigurationElementCollectionBase<T>)
ElementTagName

表示 物件的 物件 Site 集合 Application

(繼承來源 ConfigurationElement)
IsLocallyStored

取得值,指出組態專案是否儲存在特定組態檔中。

(繼承來源 ConfigurationElement)
Item[Int32]

取得位於指定索引處的組態專案。

(繼承來源 ConfigurationElementCollectionBase<T>)
Item[String]

取得集合中具有指定路徑的應用程式。

Methods

取得組態專案的方法集合。

(繼承來源 ConfigurationElement)
RawAttributes

表示 物件的 物件 Site 集合 Application

(繼承來源 ConfigurationElement)
Schema

取得描述組態專案集合的架構。

(繼承來源 ConfigurationElementCollectionBase<T>)

方法

Add(String, String)

使用指定的參數建立新的應用程式,並將它新增至應用程式集合。

Add(T)

將組態專案加入至目前集合的結尾。

(繼承來源 ConfigurationElementCollectionBase<T>)
AddAt(Int32, T)

將組態專案加入至指定索引處的目前集合。

(繼承來源 ConfigurationElementCollectionBase<T>)
Clear()

清除目前集合中的所有組態專案。

(繼承來源 ConfigurationElementCollectionBase<T>)
CreateElement()

建立目前集合的新子專案。

(繼承來源 ConfigurationElementCollectionBase<T>)
CreateElement(String)

使用指定的名稱建立新的子專案。

(繼承來源 ConfigurationElementCollectionBase<T>)
CreateNewElement(String)

使用指定的專案名稱建立新的專案。

(繼承來源 ConfigurationElementCollectionBase<T>)
Delete()

表示 物件的 物件 Site 集合 Application

(繼承來源 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)
GetEnumerator()

傳回逐一查看集合的列舉值。

(繼承來源 ConfigurationElementCollectionBase<T>)
GetMetadata(String)

從專案架構傳回中繼資料值。

(繼承來源 ConfigurationElement)
IndexOf(T)

決定集合中專案的索引。

(繼承來源 ConfigurationElementCollectionBase<T>)
InvalidApplicationPathCharacters()

擷取無法在應用程式路徑中使用的字元陣列。

Remove(T)

從集合中移除第一個出現的專案。

(繼承來源 ConfigurationElementCollectionBase<T>)
RemoveAt(Int32)

移除集合的指定索引處的項目。

(繼承來源 ConfigurationElementCollectionBase<T>)
SetAttributeValue(String, Object)

設定指定屬性的值。

(繼承來源 ConfigurationElement)
SetMetadata(String, Object)

設定專案架構中的中繼資料值。

(繼承來源 ConfigurationElement)

明確介面實作

ICollection.CopyTo(Array, Int32)

從特定的陣列索引開始,將集合的項目複製到陣列。

(繼承來源 ConfigurationElementCollectionBase<T>)
ICollection.Count

表示 物件的 物件 Site 集合 Application

(繼承來源 ConfigurationElementCollectionBase<T>)
ICollection.IsSynchronized

表示 物件的 物件 Site 集合 Application

(繼承來源 ConfigurationElementCollectionBase<T>)
ICollection.SyncRoot

表示 物件的 物件 Site 集合 Application

(繼承來源 ConfigurationElementCollectionBase<T>)
IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。

(繼承來源 ConfigurationElementCollectionBase<T>)

適用於