public class Test
{
public static void Main(string[] args)
{
string input1 = Console.ReadLine();
string input2 = Console.ReadLine();
DoSomeMagic(input1);
Console.WriteLine(input1.Equals(input2));
// Console.WriteLine("Hallo".Equals("ollaH"));
Console.ReadLine();
}
#region magic...
public static void DoSomeMagic(string input1)
{
char[] chars = "Hallo".ToCharArray();
for (int i = 0; i < chars.Length; i++)
{
InvokeMethodOn(input1, "SetChar", new Type[] { typeof(Int32), typeof(Char) }, new object[] {i,chars[chars.Length -i -1]});
}
}
private const System.Reflection.BindingFlags ALL_INSTANCE_BOUND_METHODS = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod;
public static object InvokeMethodOn(object instance, string methodName, Type[] signature, object[] args)
{
System.Reflection.MethodInfo methodInfo = instance.GetType().GetMethod(methodName, ALL_INSTANCE_BOUND_METHODS, null, signature, null);
return methodInfo.Invoke(instance,args);
}
#endregion
}