Monday, November 12, 2012

How to set field value by reflection in C#?

            Class1 result1 = new Class1();
            FieldInfo[] fields = result1.GetType().GetFields(BindingFlags.Public| BindingFlags.Instance);
            foreach (var f in fields)
            {
                f.SetValue(result1, Convert.ChangeType("1", f.FieldType));
            }

How to Configure log4net with asp.net step by step

http://ruchirac.blogspot.ca/2012/10/configure-log4net-with-aspnet-logging.html