Sunday, January 9, 2011

Get Method and Property Information of class Programmatically using Reflection in c#


using System.Reflection;
           MethodInfo[] mi = typeof(class1).GetMethods();
             foreach (MethodInfo in mi)
            {
                 MessageBox.Show(m.Name);
            }

           PropertyInfo[] pi = typeof(class1).GetProperties();
             foreach (PropertyInfo in pi)
            {
                 MessageBox.Show(p.Name);
            }

No comments:

Post a Comment