SectionInformation.AllowDefinition Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Dient zum Abrufen oder Festlegen eines Werts, der angibt, wo in der Konfigurationsdateihierarchie der zugeordnete Konfigurationsabschnitt definiert werden kann.
public:
property System::Configuration::ConfigurationAllowDefinition AllowDefinition { System::Configuration::ConfigurationAllowDefinition get(); void set(System::Configuration::ConfigurationAllowDefinition value); };
public System.Configuration.ConfigurationAllowDefinition AllowDefinition { get; set; }
member this.AllowDefinition : System.Configuration.ConfigurationAllowDefinition with get, set
Public Property AllowDefinition As ConfigurationAllowDefinition
Eigenschaftswert
Ein Wert, der angibt, wo in der Konfigurationsdateihierarchie das zugeordnete ConfigurationSection Objekt deklariert werden kann.
Ausnahmen
Der ausgewählte Wert steht in Konflikt mit einem bereits definierten Wert.
Beispiele
Die Beispiele in diesem Abschnitt zeigen, wie Sie den AllowDefinition Eigenschaftswert nach dem Zugriff auf die zugehörigen Abschnittsinformationen in der Konfigurationsdatei abrufen.
Das folgende Beispiel ruft das SectionInformation Objekt ab.
// 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
Im folgenden Beispiel wird der AllowDefinition Wert abgerufen.
ConfigurationAllowDefinition allowDefinition =
sInfo.AllowDefinition;
Console.WriteLine("Allow definition: {0}",
allowDefinition.ToString() );
Dim allowDefinition _
As ConfigurationAllowDefinition = _
sInfo.AllowDefinition
Console.WriteLine("Allow definition: {0}", _
allowDefinition.ToString())
Hinweise
AllowDefinition Gilt nur für Konfigurationsdateien von Webanwendungen. Für Clientanwendungen müssen Sie .AllowExeDefinition