|
|
От: |
desco
|
http://v2matveev.blogspot.com |
| Дата: | 01.03.16 05:59 | ||
| Оценка: | 7 (2) | ||
using System;
using System.Runtime.Serialization;
namespace ConsoleApplication1
{
class A
{
public A(string param)
{
Console.WriteLine(param);
}
}
class Program
{
static void Main(string[] args)
{
var a = (A)FormatterServices.GetUninitializedObject(typeof(A));
var ctor = typeof(A).GetConstructor(new[] { typeof(string) });
ctor.Invoke(a, new[] { "123" });
}
}
}