Hello i have converted this example https://code.msdn.microsoft.com/windowsdesktop/VBGetUserGroupInAD-a94dc080 from VB .Net to C# But i don't know how I can translate the following code row:
'Get the objectSID which is Byte array
Dim objectSid As Byte() = DirectCast(deTempForSID.Properties("objectSid").Value, Byte())
As I understod it have to be something like that, but i'm not sure, as it's not working and return array overflow:
byte[] objectSid = BitConverter.GetBytes(deTempForSID.Properties.Contains("objectSid"));
Plese can some one explain me how I can translate this code from VB .Net to C# correctly?
The correct answer, kindly suggested by Hans Passant is:
(byte[])deTempForSID.Properties["objectSid"].Value