Hello friends,
What is reflection in c#? What does it do?
Best to give some examples.
Thanks.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nhlanhla A W Mkhize20 reputationPosted Mar 5, 2014, 6:31 AM EST
Here's a simple example of reflection using the static method GetType - inherited by all types from the Object base class - to obtain the type of a variable:
// Using GetType to obtain type information: int i = 42; System.Type type = i.GetType(); System.Console.WriteLine(type);Abhishek JaiswalRank #126 · 17.5K reputationPosted Mar 5, 2014, 10:09 AM EST
go through this link to undetstand this concept better, with example:
http://www.tutorialspoint.com/csharp/csharp_reflection.htm
:) :)
Ken HRank #2,315 · 610 reputationPosted Mar 5, 2014, 3:17 PM EST
using System;
Abhay ShankerRank #375 · 6.7K reputationPosted Mar 5, 2014, 6:42 PM EST
http://www.dotnetperls.com/reflection
http://www.codeproject.com/Articles/17269/Reflection-in-C-Tutorial
http://www.csharp-examples.net/reflection-examples/