reflection omits private members.

  • Thread starter Thread starter frazer
  • Start date Start date
F

frazer

hi i have a class in which i have some private and some public members.
using reflection i iterate thru the memebers but i dont get the private ones
.. i only get the public ones. how do i get the private ones. thanx
 
hi i got it.
MethodInfo methodInfo in
type.GetMethods(BindingFlags.NonPublic|BindingFlags.Instance)
gets the private members as well , but how do i see the public and private
members together. ?
or how do i concatenate them ?
thnx
 
frazer said:
MethodInfo methodInfo in
type.GetMethods(BindingFlags.NonPublic|BindingFlags.Instance)
gets the private members as well , but how do i see the public and private
members together. ?
or how do i concatenate them ?

Use

type.GetMethods
(BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.Public)
 
Back
Top