語言

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.RightsManagement , ContentUser 僅可用於全信任申請。

建構函式

名稱 Description
ContentUser(String, AuthenticationType)

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

屬性

名稱 Description
AnyoneUser

獲得一個「任何人」 ContentUser 人格的實例。

AuthenticationType

會將指定的 輸入 AuthenticationType 給 ContentUser(String, AuthenticationType) 建構者。

Name

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

OwnerUser

獲得一個「擁有者」 ContentUser 人格的實例。

方法

名稱 Description
Equals(Object)

回傳一個值,指示此值 ContentUser 是否等同於另一個給定實例。

GetHashCode()

回傳基於使用者 Name 與 AuthenticationType的計算雜湊碼。

GetType()

取得目前實例的 Type。

(繼承來源 Object)
IsAuthenticated()

回傳一個值,表示使用者目前是否已取得認證。

MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於