Tipo di proprietà basato su stringhe di ottetti (SID)

In Servizi di dominio Active Directory le proprietà che contengono dati binari sono rappresentate con stringhe di ottetti. Le proprietà String(Octet) e String(Sid) vengono utilizzate per rappresentare questi tipi di sintassi. System.DirectoryServices rappresenta i tipi di dati binari come una matrice di valori Byte. Per ulteriori informazioni su queste proprietà, vedere gli argomenti relativi a String(Object) e String(Sid) in MSDN Library all'indirizzo https://go.microsoft.com/fwlink/?LinkID=27252 (informazioni in lingua inglese).

Nell'esempio riportato di seguito viene illustrato come leggere una proprietà SID dell'oggetto.

Dim usrSID As Byte() = CType(usr.Properties("objectSID").Value, Byte())
Dim b As Byte
For Each b In usrSID
    Console.Write("{0:x2}", b)
Next b
byte[] usrSID = (byte[])usr.Properties["objectSID"].Value;
foreach(byte b in usrSID)
{
    Console.Write("{0:x2}", b);
}

Nell'esempio riportato di seguito viene illustrato come scrivere una proprietà SID dell'oggetto.

Dim usrSID As Byte() = CType(usr.Properties("objectSid").Value, Byte())
usr.Properties("objectSid ").Clear()
usr.Properties("objectSid ").Value = usrSID
usr.CommitChanges()
byte[] usrSID = (byte[])usr.Properties["objectSid"].Value;
usr.Properties["objectSid "].Clear();
usr.Properties["objectSid "].Value = usrSID;
usr.CommitChanges();

Vedere anche

Riferimenti

System.DirectoryServices
Byte

Concetti

Tipi di proprietà

Send comments about this topic to Microsoft.

Copyright © 2007 Microsoft Corporation. Tutti i diritti riservati.