Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i Have Defined a object in C#
C#
object obj=null;


now iam instializing it in my software with

C#
obj= someobject;

through late binding

now i want to access its proprities,

How can i achive it in c# ?
Posted

1 solution

If you know for sure that the object implements a specific interface, you can case your object to that interface and access its members. This is usually faster.

On the other hand, if you are not sure of any implemented interfaces, the you can use Reflection to do this. See here[^]. Reflection is very slow and not recommended unless absolutely required.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900