Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. getting all public methods in a class

getting all public methods in a class

Scheduled Pinned Locked Moved C#
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chakkara2003
    wrote on last edited by
    #1

    hi all, how can i get the names of all public methods in a class thanx in advance coolsweety

    A 1 Reply Last reply
    0
    • C chakkara2003

      hi all, how can i get the names of all public methods in a class thanx in advance coolsweety

      A Offline
      A Offline
      alexey N
      wrote on last edited by
      #2

      Here is the code: Type methodclassType = myClass.GetType(); MethodInfo[]infos = methodclassType.GetMethods() Best regards, Alexey.

      C 1 Reply Last reply
      0
      • A alexey N

        Here is the code: Type methodclassType = myClass.GetType(); MethodInfo[]infos = methodclassType.GetMethods() Best regards, Alexey.

        C Offline
        C Offline
        chakkara2003
        wrote on last edited by
        #3

        hi thanx, now i need a small help. here is my requirement i am create one application. And which uses reflection, by using this i am all my public methods. now i want to know that is it possible to get the contents inside a public method(in this application i am loading only the assemblies) once again thanx coolsweety

        R 1 Reply Last reply
        0
        • C chakkara2003

          hi thanx, now i need a small help. here is my requirement i am create one application. And which uses reflection, by using this i am all my public methods. now i want to know that is it possible to get the contents inside a public method(in this application i am loading only the assemblies) once again thanx coolsweety

          R Offline
          R Offline
          Robert Rohde
          wrote on last edited by
          #4

          What do you mean with 'contents'? The code? You can surely fetch the IL code but this probably won't help you much. There also (complicated) ways to transform it back to C# code but it will never look exactly like the original code.

          C 1 Reply Last reply
          0
          • R Robert Rohde

            What do you mean with 'contents'? The code? You can surely fetch the IL code but this probably won't help you much. There also (complicated) ways to transform it back to C# code but it will never look exactly like the original code.

            C Offline
            C Offline
            chakkara2003
            wrote on last edited by
            #5

            thanx, i need to get the code back and to write some thing to that assembly, is it possible thanx once again coolsweety

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups