Reflection objects are used for obtaining type information at runtime. The classes that give access to the metadata of a running program are in the System.Reflection namespace.
The System.Reflection namespace contains classes that allow you to obtain information about the application and to dynamically add types, values and objects to the application.
Uses of Reflection
Reflection has the following uses:
It allows view attribute information at runtime.
It allows examining various types in an assembly and instantiate these types.
It allows late binding to methods and properties
It allows creating new types at runtime and then performs some tasks using those types.
Examples:
// Using GetType to obtain type information:
int i = 42;
System.Type type = i.GetType();
System.Console.WriteLine(type);
The output is: System.Int32
2) The following example uses reflection to obtain the full name of the loaded assembly.
// Using Reflection to get information from an Assembly:
System.Reflection.Assembly info = typeof(System.Int32).Assembly;
System.Console.WriteLine(info);
The output is: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Refer the following link for
Viewing Metadata ( attribute information) by using System.reflection namespace example
http://www.tutorialspoint.com/csharp/csharp_reflection.htm
Metadata:
"Metadata is data that describes the state of the assembly and a detailed description of each type, attribute within the assembly".
Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif
krrishbiju-15589, if this helps please login to Mark As Answer. | Alert Moderator