ContentUser(String, AuthenticationType) 생성자

정의

ContentUser 클래스의 새 인스턴스를 초기화합니다.

public:
 ContentUser(System::String ^ name, System::Security::RightsManagement::AuthenticationType authenticationType);
public ContentUser(string name, System.Security.RightsManagement.AuthenticationType authenticationType);
new System.Security.RightsManagement.ContentUser : string * System.Security.RightsManagement.AuthenticationType -> System.Security.RightsManagement.ContentUser
Public Sub New (name As String, authenticationType As AuthenticationType)

매개 변수

name
String

사용자 또는 그룹 이름입니다.

authenticationType
AuthenticationType

인증 방법입니다.

예제

다음 예제에서는 이 생성자를 사용하여 보안 환경을 만드는 방법을 보여 줍니다.

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);
    }
}
Dim applicationManifest As String = "<manifest></manifest>"
If File.Exists("rpc.xml") Then
    Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
    applicationManifest = manifestReader.ReadToEnd()
End If

If _secureEnv Is Nothing Then
    If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
        _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
    Else
        _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
    End If
End If

설명

사용자 또는 그룹은 name 종종 개별 전자 메일 주소(예: johndoe@contoso.com) 또는 메일 메일 그룹(예: marketing@contoso.com)의 형식입니다.

적용 대상