SectionInformation.AllowOverride Özellik

Tanım

İlişkili yapılandırma bölümünün alt düzey yapılandırma dosyaları tarafından geçersiz kılınıp kılınamayacağını belirten bir değer alır veya ayarlar.

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

Özellik Değeri

true bölüm geçersiz kılınabiliyorsa; aksi takdirde , false. Varsayılan değer: false.

Örnekler

Bu bölümdeki örneklerde, yapılandırma dosyasındaki AllowOverride ilgili bölüm bilgilerine erişildikten sonra özellik değerinin nasıl alınacakları gösterilir.

Aşağıdaki örnek nesnesini alır SectionInformation .

// Get the current configuration file.
System.Configuration.Configuration config =
        ConfigurationManager.OpenExeConfiguration(
        ConfigurationUserLevel.None);

// Get the section.
UrlsSection section =
    (UrlsSection)config.GetSection("MyUrls");

SectionInformation sInfo =
    section.SectionInformation;
' Get the current configuration file.
Dim config _
As System.Configuration.Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)

' Get the section.
Dim section As UrlsSection = _
CType(config.GetSection("MyUrls"), UrlsSection)

Dim sInfo As SectionInformation = _
section.SectionInformation

Aşağıdaki örnek değeri alır AllowOverride .

bool allowOverride =
    sInfo.AllowOverride;
Console.WriteLine("Allow override: {0}",
               allowOverride.ToString());
Dim allowOverride As Boolean = _
sInfo.AllowOverride
Console.WriteLine("Allow override: {0}", _
allowOverride.ToString())

Şunlara uygulanır