Impersonation Constructor (String)
Creates and unlocks an instance of Impersonation class.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public Impersonation(
	string licenseKey
)

Parameters

licenseKey
Type: SystemString
The license key. Can be a null reference (Nothing in Visual Basic) in case if the product is already unlocked (the license key was specified in app.config, web.config, Windows registry, or in MailBee.Global.LicenseKey property).
Exceptions
ExceptionCondition
MailBeeLicenseExceptionMailBee.NET Security Powerup not licensed and the supplied license key is invalid.
Remarks

If your application is multi-threaded and you need to have multiple impersonated threads, each such thread must maintain its own instance of Impersonation class. Single-threaded applications need only a single instance of this class.

To get the name of the user account being used by the current thread, call System.Security.Principal.WindowsIdentity.GetCurrent().Name.

See Also