Deeper Reflection : Field : Reflection C# Examples


C# Examples » Reflection » Field »

 

Deeper Reflection









    
using  System;
using  System.Reflection;

class  MyClass
{
        MyClass()  {}
        static  void  Process()
        {
        }
        
        public  int  MyFunction(int  i,  Decimal  d,  string[]  args)
        {
                return(0);
        }
        public  int                value  =  0;
        public  float                log  =  1.0f;
        public  static  int        value2  =  44;
}

class  MainClass
{        
        public  static  void  Main(String[]  args)
        {
                //  
                Console.WriteLine("Fields  of  MyClass");
                Type  t  =  typeof  (MyClass);
                foreach  (MemberInfo  m  in  t.GetFields())
                {
                        Console.WriteLine("{0}",  m);
                }
                
        }
}
    
   
  
   



Output

Fields of MyClass
Int32 value
Single log
Int32 value2


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Reflection
» Field