Share via


SectionInformation.IsLocked Özellik

Tanım

İlişkili yapılandırma bölümünün kilitli olup olmadığını gösteren bir değer alır.

public:
 property bool IsLocked { bool get(); };
public bool IsLocked { get; }
member this.IsLocked : bool
Public ReadOnly Property IsLocked As Boolean

Özellik Değeri

true bölüm kilitliyse; aksi takdirde , false.

Örnekler

Bu bölümdeki örneklerde, yapılandırma dosyasındaki IsLocked 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 IsLocked .

bool locked =
   sInfo.IsLocked;
Console.WriteLine("Section locked?: {0}",
    locked.ToString());
Dim locked As Boolean = _
sInfo.IsLocked
Console.WriteLine("Section locked?: {0}", _
locked.ToString())

Açıklamalar

özelliği, IsLocked ilgili bölüm veya AllowDefinition özelliği tarafından AllowOverride kilitlendiğinde döndürürtrue. Geçerli yapılandırma dosyasında geçersiz kılınamaz veya tanımlanamıyorsa bölüm kilitlenir.

Şunlara uygulanır