Opens the Web-application configuration file as a System.Configuration.Configuration object using the specified virtual path, site name, location, server, and security context to allow read or write operations.
- path
- The virtual path to the configuration file.
- site
- The name of the application Web site, as displayed in Internet Information Services (IIS) configuration.
- locationSubPath
- The specific resource to which the configuration applies.
- server
- The network name of the server the Web application resides on.
- userToken
- An account token to use.
A System.Configuration.Configuration object.
This method is used to access a configuration file using impersonation.
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.
To obtain the System.Configuration.Configuration object for a remote resource, your code must have administrative privileges on the remote computer.