ClientCredentials.Windows Tulajdonság

Definíció

Lekéri az ügyfél által a szolgáltatásban való hitelesítéshez használt Windows hitelesítő adatok vezérléséhez használt objektumot.

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

Tulajdonság értéke

Egy WindowsClientCredential, amely az aktuális Windows hitelesítő adatokat jelöli.

Példák

Az alábbi kód bemutatja, hogyan használhatja a tulajdonság által visszaadott objektumot a megszemélyesítési szint konfigurálásához.

  // 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

Megjegyzések

A tulajdonság által visszaadott objektummal konfigurálhatja a Windows hitelesítő adatokat a tagok meghívásával, például AllowNtlm és AllowedImpersonationLevel.

Ezek a beállítások az üzenet- vagy átviteli szinten az SPNEGO-egyeztetés során használt Windows hitelesítő adatokat, illetve az üzenet szintjén történő hitelesítéshez használt Kerberos-jogkivonatok tulajdonságait vezérlik.

A következőre érvényes: