{"id":285789,"date":"2017-05-02T11:45:11","date_gmt":"2017-05-02T07:45:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=285789"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=285789","title":{"rendered":"\u0421\u0430\u043c \u0441\u0435\u0431\u0435 Microsoft"},"content":{"rendered":"<p>\u041c\u044b <a href=\"https:\/\/habrahabr.ru\/post\/327096\/\">\u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438<\/a> \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 CodeDom.Compiler \u0438 \u043a\u043b\u0430\u0441\u0441\u0430 CSharpCodeProvider. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u043e\u043b\u0435\u0435 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0433\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440. \u0411\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0440\u043e\u0438\u0442 MSIL-\u043a\u043e\u0434 \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0431\u044b \u043d\u0430 C#, \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0435\u0433\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438<a name=\"habracut\"><\/a>:<\/p>\n<pre><code class=\"cpp\">using System; using System.IO; using System.Reflection; using System.Reflection.Emit;  namespace ConsoleApplication2 {     class Program     {         static void Main(string[] args)         {             Type[] par = new Type[] { typeof(Int32), typeof(Int32) };             DynamicMethod func = new DynamicMethod(&quot;AddTwoValues&quot;, typeof(Int32), par, false);             ILGenerator il = func.GetILGenerator();              \/\/ \u044d\u0442\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u043a: int AddTwoValues(int x, int y) { return x+y; }             il.Emit(OpCodes.Ldarg_0);             il.Emit(OpCodes.Ldarg_1);             il.Emit(OpCodes.Add);             il.Emit(OpCodes.Ret);              Object[] param = new Object[] { 13, 12 };   \/\/ \u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b 12 \u0438 13              int iRet=(int)func.Invoke(null, param);     \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c              \/\/ \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c             Console.WriteLine(&quot;{0}+{1}={2}&quot;, param[0], param[1], iRet);           }     } }<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/dff\/b79\/224\/dffb792240974ea19cc4184eaab34860.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0432 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0443\u0436\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 MSIL-\u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b. \u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0436\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u00ab\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0430\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 80-\u0445 \u0433\u043e\u0434\u043e\u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0432\u0435\u043a\u0430 \u043f\u044b\u043b\u0438\u0442\u0441\u044f \u0443 \u043c\u0435\u043d\u044f \u0432 \u0441\u0442\u043e\u043b\u0435. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0443\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u043e\u043c \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043d\u0430\u043c\u0438 \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb:<\/p>\n<pre><code class=\"cpp\">using System; using System.IO; using System.Reflection; using System.Reflection.Emit;  namespace ConsoleApplication2 {     class Program     {         static void Main(string[] args)         {             Type[] par = new Type[] { typeof(Int32), typeof(Int32) };             DynamicMethod func = new DynamicMethod(&quot;AddTwoValues&quot;, typeof(Int32), par, false);             ILGenerator il = func.GetILGenerator();              MethodInfo fnWriteLine = typeof(Console).                                      GetMethod(&quot;WriteLine&quot;, new Type[] { typeof(Int32) });              il.Emit(OpCodes.Ldarg_0);             il.Emit(OpCodes.Call, fnWriteLine);             il.Emit(OpCodes.Ldarg_1);             il.Emit(OpCodes.Call, fnWriteLine);              il.Emit(OpCodes.Ldarg_0);             il.Emit(OpCodes.Ldarg_1);             il.Emit(OpCodes.Add);             il.Emit(OpCodes.Ret);              Object[] param = new Object[] { 13, 12 };   \/\/ \u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b 12 \u0438 13              int iRet=(int)func.Invoke(null, param);     \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c              \/\/ \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c             Console.WriteLine(&quot;{0}+{1}={2}&quot;, param[0], param[1], iRet);         }     } }<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4e3\/111\/99d\/4e311199d811406a95bbdc3a32e04ed7.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c MSIL-\u043a\u043e\u0434 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0438\u0437 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e MSIL \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u0418 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0432\u043b\u0430\u0441\u0442\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e \u2013 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u044b\u0437\u043e\u0432 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e callback-\u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451.<br \/>  \u0427\u0442\u043e \u043d\u0430\u0441 \u0435\u0449\u0451 \u043e\u0442\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f? \u0414\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0435\u0433\u043e \u043f\u0430\u0440\u0441\u0435\u0440! \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0441\u0435\u0440, \u0442\u043e \u043d\u0438\u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u0448\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c:<\/p>\n<p>  <code>\u0415\u0421\u041b\u0418 \u041a\u041b\u0418\u0415\u041d\u0422 \u0410\u041a\u0422\u0418\u0412\u0415\u041d<br \/>  \u041d\u0410\u0427\u0410\u041b\u041e \u0411\u041b\u041e\u041a\u0410<br \/>   \u041a\u0423\u041f\u0418\u0422\u042c \u0411\u0418\u041b\u0415\u0422 \u041d\u0410 \u041f\u041e\u0415\u0417\u0414 120 \u043d\u0430 31\/12\/2017 \u041a\u0423\u041f\u0415\u0419\u041d\u042b\u0419 \u041d\u0418\u0416\u041d\u0415\u0415 <br \/>   \u0420\u0410\u0421\u041f\u0415\u0427\u0410\u0422\u0410\u0422\u042c \u0411\u041b\u0410\u041d\u041a<br \/>  \u041a\u041e\u041d\u0415\u0426 \u0411\u041b\u041e\u041a\u0410<\/code><\/p>\n<p>  \u041e \u043f\u0430\u0440\u0441\u0435\u0440\u0435 \u0438 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043f\u043e\u0439\u0434\u0451\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/327580\/\"> https:\/\/habrahabr.ru\/post\/327580\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041c\u044b <a href=\"https:\/\/habrahabr.ru\/post\/327096\/\">\u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438<\/a> \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 CodeDom.Compiler \u0438 \u043a\u043b\u0430\u0441\u0441\u0430 CSharpCodeProvider. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u043e\u043b\u0435\u0435 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0433\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440. \u0411\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0440\u043e\u0438\u0442 MSIL-\u043a\u043e\u0434 \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0431\u044b \u043d\u0430 C#, \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0435\u0433\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-285789","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=285789"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285789\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=285789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=285789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=285789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}