Skip to content

Instantly share code, notes, and snippets.

@chaliy
Created August 8, 2010 13:30
Show Gist options
  • Save chaliy/514022 to your computer and use it in GitHub Desktop.
Save chaliy/514022 to your computer and use it in GitHub Desktop.
reateObjWithInvoike
class Program
{
public static void Main()
{
var ctor = typeof (R).GetConstructor(new Type[] {typeof (string)});
var result = (R)ctor.Invoke(new object[]{"a"});
result.Test();
}
}
public class R
{
public R(string stuff)
{
}
private string _test = "test";
public void Test()
{
Console.WriteLine(_test);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment