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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Snooping a class

Snooping a class

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasehelp
4 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
    Chinners
    wrote on last edited by
    #1

    Hi all, I am trying to write a bit of code in VB.NET (2008) that will look inside a class and find all the public members, e.g.

    Public Class User
    public Name as string
    public Dob as date
    public Department as integer
    (etc)
    End Class

    Is there a way for a subroutine to accept an instance of the class as an object, and query it for all these public items. I would search with google, but I dont know what to look for :sigh: Any help, or pointers would be much appreciated!

    CPalliniC J 2 Replies Last reply
    0
    • C Chinners

      Hi all, I am trying to write a bit of code in VB.NET (2008) that will look inside a class and find all the public members, e.g.

      Public Class User
      public Name as string
      public Dob as date
      public Department as integer
      (etc)
      End Class

      Is there a way for a subroutine to accept an instance of the class as an object, and query it for all these public items. I would search with google, but I dont know what to look for :sigh: Any help, or pointers would be much appreciated!

      CPalliniC Online
      CPalliniC Online
      CPallini
      wrote on last edited by
      #2

      See [^]. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

      In testa che avete, signor di Ceprano?

      C 1 Reply Last reply
      0
      • C Chinners

        Hi all, I am trying to write a bit of code in VB.NET (2008) that will look inside a class and find all the public members, e.g.

        Public Class User
        public Name as string
        public Dob as date
        public Department as integer
        (etc)
        End Class

        Is there a way for a subroutine to accept an instance of the class as an object, and query it for all these public items. I would search with google, but I dont know what to look for :sigh: Any help, or pointers would be much appreciated!

        J Offline
        J Offline
        Jay Royall
        wrote on last edited by
        #3

        I am fairly new VB.NET but I believe that the Reflection class can achieve this. Somebody please correct me if I'm wrong, but inthe mean time you could try Google'in Reflection.

        1 Reply Last reply
        0
        • CPalliniC CPallini

          See [^]. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          C Offline
          C Offline
          Chinners
          wrote on last edited by
          #4

          Anyone got a version of that in English? :) Tough reading, but I am sure it is what I need to get my head around to do what I want. Thanks.

          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