How can I read out all property names via reflection of an COM Object in C#?
I know how to get the property if I know the name.
comObject.GetType().InvokeMember("PropertyName", System.Reflection.BindingFlags.GetProperty, null, comObject, null);
but what is when I want to dump all properties?
PropertyInfo[] properties = t.GetProperties();
This way didn't work with Com-Objects. If I do a GetMembers() I get these Members:
Name: GetLifetimeService
Name: InitializeLifetimeService
Name: CreateObjRef
Name: ToString
Name: Equals
Name: GetHashCode
Name: GetType
regards Chris
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…