本文整理汇总了VB.NET中System.IO.Packaging.RightsManagementInformation.LoadUseLicense方法的典型用法代码示例。如果您正苦于以下问题:VB.NET RightsManagementInformation.LoadUseLicense方法的具体用法?VB.NET RightsManagementInformation.LoadUseLicense怎么用?VB.NET RightsManagementInformation.LoadUseLicense使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.Packaging.RightsManagementInformation
的用法示例。
在下文中一共展示了RightsManagementInformation.LoadUseLicense方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: ContentUser
ShowStatus(" Opening the encrypted Package.")
Dim ePackage As EncryptedPackageEnvelope = EncryptedPackageEnvelope.Open(xpsFile, FileAccess.ReadWrite)
Dim rmi As RightsManagementInformation = ePackage.RightsManagementInformation
ShowStatus(" Looking for an embedded UseLicense for user:" & vbLf & " " & currentUserId & " [" & _authentication & "]")
Dim useLicense As UseLicense = rmi.LoadUseLicense(New ContentUser(currentUserId, _authentication))
Dim grants As ReadOnlyCollection(Of ContentGrant)
If useLicense Is Nothing Then
ShowStatus(" No Embedded UseLicense found." & vbLf & " " & "Attempting to acqure UseLicnese" & vbLf & " " & "from the PublishLicense.")
Dim pubLicense As PublishLicense = rmi.LoadPublishLicense()
ShowStatus(" Referral information:")
If pubLicense.ReferralInfoName Is Nothing Then
ShowStatus(" Name: (null)")
Else
ShowStatus(" Name: " & pubLicense.ReferralInfoName)
End If
If pubLicense.ReferralInfoUri Is Nothing Then
ShowStatus(" Uri: (null)")
Else
ShowStatus(" Uri: " & pubLicense.ReferralInfoUri.ToString())
End If
useLicense = pubLicense.AcquireUseLicense(_secureEnv)
If useLicense Is Nothing Then
ShowStatus(" User DOES NOT HAVE RIGHTS" & vbLf & " " & "to access this document!")
Return False
End If
End If ' end:if (useLicense == null)
ShowStatus(" UseLicense acquired.")