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).

적용 대상