Tipo di proprietà LargeInteger

Le proprietà dello schema Servizi di dominio Active Directory, come lastLogon, utilizzano il tipo di sintassi LargeInteger. Per ulteriori informazioni sulla proprietà lastLogon o sul tipo di sintassi LargeInteger, vedere gli argomenti relativi in MSDN Library all'indirizzo https://go.microsoft.com/fwlink/?LinkID=27252 (informazioni in lingua inglese).

Se si ottiene una proprietà di questo tipo con la proprietà Properties, questo tipo di dati viene rappresentato come un oggetto COM di cui può essere eseguito il cast a IADsLargeInteger. Per ulteriori informazioni sul tipo IADsLargeInteger, vedere l'argomento relativo a IADsLargeInteger nella MSDN Library all'indirizzo https://go.microsoft.com/fwlink/?LinkID=27252 (informazioni in lingua inglese).

Se si ottiene una proprietà di questo tipo da ResultPropertyValueCollection, questo tipo di dati viene rappresentato come una struttura Int64.

Nell'esempio riportato di seguito viene illustrato come convertire il tipo IADsLargeInteger nel tipo DateTime.

public static DateTime GetDateTimeFromLargeInteger(IADsLargeInteger largeIntValue)
{
    //
    // Convert large integer to int64 value
    //
    long int64Value = (long)((uint)largeIntValue.LowPart +
             (((long)largeIntValue.HighPart) << 32 ));  

    //
    // Return the DateTime in utc
    //
    return DateTime.FromFileTimeUtc(int64Value);
}

Nell'esempio riportato di seguito viene illustrato come convertire il formato DateTime in IADsLargeInteger.

public static IADsLargeInteger GetLargeIntegerFromDateTime(DateTime dateTimeValue)
{
    //
    // Convert DateTime value to utc file time
    //
    Int64 int64Value = dateTimeValue.ToFileTimeUtc();

    //
    // convert to large integer
    //
    IADsLargeInteger largeIntValue = 
         IADsLargeInteger) new LargeInteger();
    largeIntValue.HighPart = (int) (int64Value >> 32);
    largeIntValue.LowPart = (int) (int64Value & 0xFFFFFFFF);

    return largeIntValue;
}

Vedere anche

Riferimenti

System.DirectoryServices
DirectoryEntry
ResultPropertyValueCollection

Concetti

Tipi di proprietà

Send comments about this topic to Microsoft.

Copyright © 2007 Microsoft Corporation. Tutti i diritti riservati.