Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Access private members?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gjoshi029 - 31 Mar 2008 06:06 GMT
Is there any way to access private members in inheritance chain.
Peter Duniho - 31 Mar 2008 06:25 GMT
> Is there any way to access private members in inheritance chain.

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
Gjoshi029 - 31 Mar 2008 06:34 GMT
On Mar 31, 10:25 am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> > Is there any way to access private members in inheritance chain.
>
[quoted text clipped - 12 lines]
>
> Pete

Thanks for your help.

Girish

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.