Access private members?

  • Thread starter Thread starter Gjoshi029
  • Start date Start date
Any way? Yes, of course.

But if you're asking whether there's a way to write code that at compile
time explicitly refers to private members, the answer is no. And you
should think very carefully before bypassing the language features that
block access to private members. And if you find after thinking carefully
that you still want to do it, you should think carefully again.

If after all of that, you still insist on doing such a dastardly deed,
you'll want to look at the System.Reflection namespace for specific
classes that can help you do it properly (inasmuch as there's any way to
do it properly).

Pete

Thanks for your help.

Girish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top