Credentials Property

log4net SDK Reference |

# WindowsSecurityContext.Credentials Property

Gets or sets the impersonation mode for this security context

[Visual Basic]
Public Property Credentials As ImpersonationMode
[C#]
public WindowsSecurityContext.ImpersonationMode Credentials {get; set;}

#### Property Value

The impersonation mode for this security context

#### Remarks

Impersonate either a user with user credentials or revert this thread to the credentials of the process. The value is one of the WindowsSecurityContext.ImpersonationMode enum.

The default value is User

When the mode is set to User the user's credentials are established using the UserName, DomainName and Password values.

When the mode is set to Process no other properties need to be set. If the calling thread is impersonating then it will be reverted back to the process credentials.

#### See Also

WindowsSecurityContext Class | log4net.Util Namespace