Sign in to follow this  

[.net] Reflection Tutorial

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Reflection is a big topic and as you are focusing on a fairly small application of reflection, I would recomend changing your title to reflect that.

Something like "Accessing private methods and data with reflection" or "Using reflection to circumvent compile time code security".

Otherwise, it is solid and simple. Thanks for sharing your knowledge. [smile]

Share this post


Link to post
Share on other sites
A couple of comments:

Reflection is a method of getting aroung <- should be "around"

"The purpose of reflection is to get access to private or protected methods"
I don't think this is entirely true - the purpose of it is to access methods, fields etc through code - you can access public methods also, and I believe security demands can be set to make reflection obey the access specifications of members and types. It can be used to circunvent access - but only if security for that binary hasn't been set up to stop it.

Reflection allows you to query objects for what methods they own, what attributes they have and use them , basically allowing for typeless programing. If you really want or need it :)

Share this post


Link to post
Share on other sites

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this