Monday, August 25, 2014

How to get list of properties of dynamic object ?

You could do this using reflection:



Type outlookType = Type.GetTypeFromProgID( "Outlook.Application" );
dynamic outlookApp = Activator.CreateInstance( outlookType );
foreach (var prop in outlookApp.GetType().GetProperties())
{
string propName = prop.Name;
object value = prop.GetValue(outlookApp, null);
}


No comments:

Post a Comment