SectionInformation.AllowExeDefinition Eigenschap

Definitie

Hiermee wordt een waarde opgehaald of ingesteld die aangeeft waar in de configuratiebestandshiërarchie de bijbehorende configuratiesectie kan worden gedeclareerd.

public:
 property System::Configuration::ConfigurationAllowExeDefinition AllowExeDefinition { System::Configuration::ConfigurationAllowExeDefinition get(); void set(System::Configuration::ConfigurationAllowExeDefinition value); };
public System.Configuration.ConfigurationAllowExeDefinition AllowExeDefinition { get; set; }
member this.AllowExeDefinition : System.Configuration.ConfigurationAllowExeDefinition with get, set
Public Property AllowExeDefinition As ConfigurationAllowExeDefinition

Waarde van eigenschap

Een waarde die aangeeft waar in de configuratiebestandshiërarchie het bijbehorende ConfigurationSection object kan worden gedeclareerd voor .exe bestanden.

Uitzonderingen

De geselecteerde waarde conflicteert met een waarde die al is gedefinieerd.

Voorbeelden

In de voorbeelden in deze sectie ziet u hoe u de AllowExeDefinition 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 AllowExeDefinition waarde opgehaald.

ConfigurationAllowExeDefinition allowExeDefinition =
                sInfo.AllowExeDefinition;
Console.WriteLine("Allow exe definition: {0}",
   allowExeDefinition.ToString());
Dim allowExeDefinition _
As ConfigurationAllowExeDefinition = _
sInfo.AllowExeDefinition
Console.WriteLine("Allow exe definition: {0}", _
allowExeDefinition.ToString())

Opmerkingen

AllowExeDefinition is alleen van toepassing op configuratiebestanden van clienttoepassingen. Voor webtoepassingen moet u dit gebruiken AllowDefinition.

Van toepassing op

Zie ook