RightsManagementException Class
.NET Framework 3.0
Represents an error condition when a rights management operation cannot complete successfully.
Namespace: System.Security.RightsManagement
Assembly: WindowsBase (in windowsbase.dll)
Assembly: WindowsBase (in windowsbase.dll)
The following example shows use of the RightsManagementException. For the full sample, see Rights Managed Package Publish Sample.
WriteStatus(" Building secure environment."); try { 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); } } } catch (RightsManagementException ex) { MessageBox.Show("ERROR: Failed to build secure environment.\n" + "Exception: " + ex.Message + "\n\n" + ex.FailureCode.ToString() + "\n\n" + ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error); return false; }
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: