ClientCredentials.Windows Свойство

Определение

Возвращает объект, используемый, чтобы контролировать учетные данные Windows, используемые клиентом для проверки подлинности самого себя для службы.

public:
 property System::ServiceModel::Security::WindowsClientCredential ^ Windows { System::ServiceModel::Security::WindowsClientCredential ^ get(); };
public System.ServiceModel.Security.WindowsClientCredential Windows { get; }
member this.Windows : System.ServiceModel.Security.WindowsClientCredential
Public ReadOnly Property Windows As WindowsClientCredential

Значение свойства

WindowsClientCredential, представляющий текущую учетную запись Windows.

Примеры

В следующем примере кода показано применение объекта, возвращенного этим свойством, для настройки уровня олицетворения.

  // Create a client object with the given client endpoint configuration.
 CalculatorClient client = new CalculatorClient();
try
  {
      client.ClientCredentials.Windows.AllowedImpersonationLevel
          = TokenImpersonationLevel.Impersonation;
  }
  catch (TimeoutException timeProblem)
  {
    Console.WriteLine("The service operation timed out. " + timeProblem.Message);
    Console.ReadLine();
    client.Abort();
  }
  catch (CommunicationException commProblem)
  {
    Console.WriteLine("There was a communication problem. " + commProblem.Message + commProblem.StackTrace);
    Console.ReadLine();
    client.Abort();
  }
  ' Create a client object with the given client endpoint configuration.
 Dim client As New CalculatorClient()
Try
      client.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation
  Catch timeProblem As TimeoutException
    Console.WriteLine("The service operation timed out. " & timeProblem.Message)
    Console.ReadLine()
    client.Abort()
  Catch commProblem As CommunicationException
    Console.WriteLine("There was a communication problem. " & commProblem.Message + commProblem.StackTrace)
    Console.ReadLine()
    client.Abort()
  End Try

Комментарии

Можно использовать объект, возвращенный этим свойством, для настройки учетной записи Windows путем вызова его участников, например, AllowNtlm и AllowedImpersonationLevel.

Эти параметры контролируют учетную запись Windows во время согласования SPNEGO на уровне сообщения или транспорта или свойств маркеров Kerberos, используемых для проверки подлинности на уровне сообщения.

Применяется к