ConfigurationManager::OpenExeConfiguration Method (String^)

 

Opens the specified client configuration file as a Configuration object.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public:
static Configuration^ OpenExeConfiguration(
	String^ exePath
)

Parameters

exePath
Type: System::String^

The path of the executable (exe) file.

Exception Condition
ConfigurationErrorsException

A configuration file could not be loaded.

Client applications use a global configuration that applies to all users, separate configurations that apply to individual users, and configurations that apply to roaming users. The userLevel value determines the location of the configuration file being opened. It indicates whether it has no user level (the configuration file is in the same directory as the application) or has a per-user level (the configuration file is in an application settings path determined by the user level type.).

Calling this method overload is equivalent to calling the OpenMappedExeConfiguration(ExeConfigurationFileMap^, ConfigurationUserLevel, Boolean) overload with the preLoad parameter set to false.

The following code example shows how to use the OpenExeConfiguration method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: