SectionInformation.AllowExeDefinition Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, gdzie w hierarchii plików konfiguracji można zadeklarować skojarzona sekcja konfiguracji.

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

Wartość właściwości

Wartość wskazująca, gdzie w hierarchii plików konfiguracji można zadeklarować skojarzony ConfigurationSection obiekt dla .exe plików.

Wyjątki

Wybrana wartość powoduje konflikt z już zdefiniowaną wartością.

Przykłady

W przykładach w tej sekcji pokazano, jak uzyskać AllowExeDefinition wartość właściwości po dokonaniu dostępu do powiązanych informacji sekcji w pliku konfiguracji.

Poniższy przykład pobiera SectionInformation obiekt .

// 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

Poniższy przykład pobiera AllowExeDefinition wartość.

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())

Uwagi

AllowExeDefinition dotyczy tylko plików konfiguracji aplikacji klienckich. W przypadku aplikacji internetowych należy użyć polecenia AllowDefinition.

Dotyczy

Zobacz też