.NET Framework

HOW Convert COM interface unknown value to C# type value

Y2K 2009. 1. 7. 13:05

32bit com value convert 64bit value

ex:DateTime, long, double.. etc

using reference : COM Data Type

ActiveDs.IADsLargeInteger largeIntADSI = (ActiveDs.IADsLargeInteger) entity.Properties["lastLogonTimestamp"][0];
long timevalue = (long)largeIntADSI.HighPart << 32 | (uint)largeIntADSI.LowPart;
DateTime lastlogontime = DateTime.FromFileTimeUtc(timevalue);
Console.WriteLine(lastlogontime);