System.Web.Configuration.WebConfigurationManager.OpenMachineConfiguration Method

Opens the specified machine-configuration file on the specified server as a System.Configuration.Configuration object, using the specified security context to allow read or write operations.

Syntax

public static System.Configuration.Configuration OpenMachineConfiguration (string locationSubPath, string server, IntPtr userToken)

Parameters

locationSubPath
The application path to which the configuration applies.
server
The fully qualified name of the server to return the configuration for.
userToken
An account token to use.

Returns

A System.Configuration.Configuration object.

Remarks

This method is used to access a configuration file using impersonation.

Note:

The account token is usually retrieved from an instance of the System.Security.Principal.WindowsIdentity class or through a call to unmanaged code, such as a call to the Win32 API LogonUser. For more information about calls to unmanaged code, see Consuming Unmanaged DLL Functions.

Requirements

Namespace: System.Web.Configuration
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0