Aracılığıyla paylaş


SectionInformation.IsProtected Özellik

Tanım

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

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

Özellik Değeri

true bu ConfigurationSection korumalıysa; korunmazsa, false. Varsayılan değer: false.

Örnekler

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

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

Açıklamalar

Korumalı yapılandırma bölümleri şifrelenir ve salt okunur olur.

Korumalı yapılandırma bölümleri hakkında daha fazla bilgi için bkz. Korumalı Yapılandırma Kullanarak Yapılandırma Bilgilerini Şifreleme.

Şunlara uygulanır

Ayrıca bkz.