ContentUser 類別

定義

代表要授與版權管理內容存取權的使用者或使用者群組。

public ref class ContentUser
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class ContentUser
public class ContentUser
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type ContentUser = class
type ContentUser = class
Public Class ContentUser
繼承
ContentUser
屬性

範例

下列範例示範如何使用 Owner 屬性來指派此類型的變數。

WriteStatus("   Reading '" + xrmlFilename + "' permissions.");
try
{
    StreamReader sr = File.OpenText(xrmlFile);
    xrmlString = sr.ReadToEnd();
}
catch (Exception ex)
{
    MessageBox.Show("ERROR: '"+xrmlFilename+"' open failed.\n"+
        "Exception: " + ex.Message, "XrML File Error",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}

WriteStatus("   Building UnsignedPublishLicense");
WriteStatus("       from '" + xrmlFilename + "'.");
UnsignedPublishLicense unsignedLicense =
    new UnsignedPublishLicense(xrmlString);
ContentUser author = unsignedLicense.Owner;
WriteStatus("   Reading '" & xrmlFilename & "' permissions.")
Try
    Dim sr As StreamReader = File.OpenText(xrmlFile)
    xrmlString = sr.ReadToEnd()
Catch ex As Exception
    MessageBox.Show("ERROR: '" & xrmlFilename &"' open failed." & vbLf & "Exception: " & ex.Message, "XrML File Error", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

WriteStatus("   Building UnsignedPublishLicense")
WriteStatus("       from '" & xrmlFilename & "'.")
Dim unsignedLicense As New UnsignedPublishLicense(xrmlString)
Dim author As ContentUser = unsignedLicense.Owner

備註

如同其他類型的 System.Security.RightsManagementContentUser 只能在完全信任應用程式中使用。

建構函式

ContentUser(String, AuthenticationType)

初始化 ContentUser 類別的新執行個體。

屬性

AnyoneUser

取得 "Anyone" ContentUser 角色的執行個體。

AuthenticationType

取得指定給 AuthenticationType 建構函式的 ContentUser(String, AuthenticationType)

Name

取得指定給 ContentUser(String, AuthenticationType) 建構函式的使用者或群組名稱。

OwnerUser

取得 "Owner" ContentUser 角色的執行個體。

方法

Equals(Object)

傳回值,指出這個 ContentUser 是否相當於另一個特定執行個體。

GetHashCode()

傳回根據使用者 NameAuthenticationType 計算出的雜湊程式碼。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsAuthenticated()

傳回值,指出使用者目前是否已驗證。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於