CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2008
    Posts
    14

    How to find the base class on object?

    Hello all,
    In one of my work I have a situation as explained below....

    I have an object. I am able to find the type of the object using Gettype() method.

    But to work out my logic, I want to find what is the base class of the object?

    I there any way we can do this in c#? If so, Please help me...

    Regards
    RadKrish

  2. #2
    Join Date
    May 2007
    Posts
    1,546

    Re: How to find the base class on object?

    Look for methods or properties with'base' in the name on the type object
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  3. #3
    Join Date
    Nov 2008
    Posts
    14

    Re: How to find the base class on object?

    I just tried this and it worked....
    ObjecM.GetType().BaseType

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured