SectionInformation.IsLocked Eigenschap
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee wordt een waarde opgehaald die aangeeft of de bijbehorende configuratiesectie is vergrendeld.
public:
property bool IsLocked { bool get(); };
public bool IsLocked { get; }
member this.IsLocked : bool
Public ReadOnly Property IsLocked As Boolean
Waarde van eigenschap
true als de sectie is vergrendeld; anders, false.
Voorbeelden
In de voorbeelden in deze sectie ziet u hoe u de IsLocked eigenschapswaarde kunt ophalen nadat u de gerelateerde sectiegegevens in het configuratiebestand hebt geopend.
In het volgende voorbeeld wordt het SectionInformation object opgehaald.
// 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
In het volgende voorbeeld wordt de IsLocked waarde opgehaald.
bool locked =
sInfo.IsLocked;
Console.WriteLine("Section locked?: {0}",
locked.ToString());
Dim locked As Boolean = _
sInfo.IsLocked
Console.WriteLine("Section locked?: {0}", _
locked.ToString())
Opmerkingen
De IsLocked eigenschap wordt geretourneerd true wanneer de gerelateerde sectie is vergrendeld door de AllowOverride of de AllowDefinition eigenschap. Een sectie is vergrendeld als deze niet kan worden overschreven of gedefinieerd in het huidige configuratiebestand.