SectionInformation.InheritInChildApplications 屬性

定義

取得或設定值,這個值會指出位於相關應用程式子目錄中的應用程式是否會繼承關聯組態區段中指定的設定。

public:
 property bool InheritInChildApplications { bool get(); void set(bool value); };
public bool InheritInChildApplications { get; set; }
member this.InheritInChildApplications : bool with get, set
Public Property InheritInChildApplications As Boolean

屬性值

如果在此 ConfigurationSection 物件中指定之設定會由子應用程式所繼承,則為 true,否則為 false。 預設為 true

範例

下列範例示範如何取得 InheritInChildApplications 物件的值 ConfigurationSection

static public void GetInheritInChildApps()
{
    SectionInformation sInfo =
        GetSectionInformation();

    bool inheritInChildApps =
        sInfo.InheritInChildApplications;
    Console.WriteLine("Inherit in child apps: {0}",
        inheritInChildApps.ToString());
}
Public Shared Sub GetInheritInChildApps() 

    Dim sInfo As SectionInformation = _
    GetSectionInformation()
    
    Dim inheritInChildApps As Boolean = _
    sInfo.InheritInChildApplications
    Console.WriteLine("Inherit in child apps: {0}", _
    inheritInChildApps.ToString())

End Sub

備註

屬性 InheritInChildApplications 代表 inheritInChildApplications 組態檔中項目的屬性 location

設定 InheritInChildApplicationsfalse 以防止特定位置的特定設定 (例如網站根目錄,) 存在於子目錄中的應用程式繼承。

下列範例示範如何在組態檔中使用此屬性,以指定子應用程式不應繼承網站根目錄之location元素中定義的設定:

<location path="." inheritInChildApplications="false">

屬性 InheritInChildApplications 僅適用於位置特定的組態設定。

適用於