Jul 8, 2011 12:16 AM
(This post was last modified: Jul 8, 2011 09:52 PM by eliteh4xer.)
Using Reflection in C#
Ques : What Is Reflection ,How to Implement ? 😯 😟
[color=#ff]Ans: 😎
Reflection is generally all about getting information about code. Reflection is most commonly used for discovery, and nearly everything in .NET is discoverable.
You Can Create Your Own 🤭 .Net Reflector if you Know Some Basic In Class , Tree View etc . 😝[/color]
More About Reflection in C#
Now Lets Create A .dll File In Visual studio 2010 in Visual c#
😝
PHP Code
<?php
Namespace ToTest // Namespace
{
public class Calc //Class Name
{
public Calc() { ... }
public void Clear() { ... }
private void DoClear() { ... }
public double Add(double number) { ... }
public static double Pi { ... }
public static double GetPi() { ... }
}
}
Now Take Other Windows Form in C#
Add a Button Just and A Textbox To Enter The Path of .dll or assembly
[img]http://i56.[censored].com/2vjq1av.png[/img]
Now Creating Assembly Object
PHP Code
<?php
using System.Reflection; // Do not Forget it
[img]http://i51.[censored].com/r7pt00.png[/img]
Quote:In Form Load
Assembly testAssembly = Assembly.LoadFile(textbox.text);
Type T = testAssembly.GetTypes();
Now Add Message Box To See the .dll
[img]http://i55.[censored].com/142boe0.png[/img]
[img]http://i52.[censored].com/2v1ry2f.png[/img]
PHP Code
<?php
You Can Get MethodInfo,PropertyInfo also and Create Object Of Class and Execute Them Also.
Now This Is Simple Tut ,How to Implement Reflection .
For More Go to This Link
Thanks
👍
Respect
Mr. Predictable


