Share via


ManagementConfiguration.GetSection Method

Definition

Retrieves the specified configuration section.

Overloads

GetSection(String)

Retrieves the configuration section at the specified path.

GetSection(String, Type)

Retrieves the configuration section at the specified section path.

GetSection(String, ManagementConfigurationPath, Boolean)

Retrieves the configuration section at the specified path.

GetSection(String, Type, ManagementConfigurationPath, Boolean)

Retrieves the configuration section at the specified path.

GetSection(String)

Retrieves the configuration section at the specified path.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath);
member this.GetSection : string -> Microsoft.Web.Administration.ConfigurationSection
Public Function GetSection (sectionPath As String) As ConfigurationSection

Parameters

sectionPath
String

The section string.

Returns

A ConfigurationSection that contains the contents of the specified section.

Examples

The following example uses the GetSection(String) method to retrieve the contents of the "appSettings" section.

public class DemoModuleService : ModuleService {

    [ModuleServiceMethod]
    public ArrayList GetSettings() {
        ManagementConfiguration manConfig = this.ManagementUnit.Configuration;
        ConfigurationSection appSetSect = manConfig.GetSection("appSettings");
        ConfigurationElementCollection settings = appSetSect.GetCollection();

}
}

Applies to

GetSection(String, Type)

Retrieves the configuration section at the specified section path.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath, Type ^ sectionType);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath, Type sectionType);
member this.GetSection : string * Type -> Microsoft.Web.Administration.ConfigurationSection
Public Function GetSection (sectionPath As String, sectionType As Type) As ConfigurationSection

Parameters

sectionPath
String

The section path.

sectionType
Type

The section Type.

Returns

A ConfigurationSection that contains the contents of the specified section.

Applies to

GetSection(String, ManagementConfigurationPath, Boolean)

Retrieves the configuration section at the specified path.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath, Microsoft::Web::Management::Server::ManagementConfigurationPath ^ path, bool respectDelegation);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath, Microsoft.Web.Management.Server.ManagementConfigurationPath path, bool respectDelegation);
member this.GetSection : string * Microsoft.Web.Management.Server.ManagementConfigurationPath * bool -> Microsoft.Web.Administration.ConfigurationSection
Public Function GetSection (sectionPath As String, path As ManagementConfigurationPath, respectDelegation As Boolean) As ConfigurationSection

Parameters

sectionPath
String

The section path.

path
ManagementConfigurationPath

A ManagementConfigurationPath that specifies the management configuration path.

respectDelegation
Boolean

true to respect delegation; false to disregard delegation.

Returns

A ConfigurationSection that contains the contents of the specified section.

Applies to

GetSection(String, Type, ManagementConfigurationPath, Boolean)

Retrieves the configuration section at the specified path.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath, Type ^ sectionType, Microsoft::Web::Management::Server::ManagementConfigurationPath ^ path, bool respectDelegation);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath, Type sectionType, Microsoft.Web.Management.Server.ManagementConfigurationPath path, bool respectDelegation);
member this.GetSection : string * Type * Microsoft.Web.Management.Server.ManagementConfigurationPath * bool -> Microsoft.Web.Administration.ConfigurationSection
Public Function GetSection (sectionPath As String, sectionType As Type, path As ManagementConfigurationPath, respectDelegation As Boolean) As ConfigurationSection

Parameters

sectionPath
String

The section path.

sectionType
Type

The section Type.

path
ManagementConfigurationPath

A ManagementConfigurationPath that specifies the management configuration path.

respectDelegation
Boolean

true to respect delegation; false to disregard delegation.

Returns

A ConfigurationSection that contains the contents of the specified section.

Applies to