This documentation is archived and is not being maintained.
SecureEnvironment Class
Visual Studio 2008
Represents a secure client session for user activation, license binding, and other rights management operations.
Assembly: WindowsBase (in WindowsBase.dll)
As with other System.Security.RightsManagement types, SecureEnvironment is only usable in full trust applications.
The following example shows use of the SecureEnvironment class. For the full sample, see Rights Managed Package Publish Sample.
string applicationManifest = "<manifest></manifest>"; if (File.Exists("rpc.xml")) { StreamReader manifestReader = File.OpenText("rpc.xml"); applicationManifest = manifestReader.ReadToEnd(); } if (_secureEnv == null) { if (SecureEnvironment.IsUserActivated(new ContentUser( _currentUserId, AuthenticationType.Windows))) { _secureEnv = SecureEnvironment.Create( applicationManifest, new ContentUser( _currentUserId, AuthenticationType.Windows)); } else { _secureEnv = SecureEnvironment.Create( applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent); } }
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: