English 中文(简体)
如何确定幕后发生的事情。 净额
原标题:How to determine what happens behind the scene in .Net
  • 时间:2009-10-30 06:09:13
  •  标签:

什么工具或方法,我可以用来看到,像匿名方法或准则说明这样的一些法典被编纂成什么? 基本上看看幕后发生的情况?

最佳回答

Reflector是这样做的极好方法。

争取观点/选择/优化和选择“None”,以便它能赢得尝试完成最初的C#。

例如,<代码>Main 这种方法很少:

using System;

class Test    
{
    static void Main()
    {
        string other = "hello";
        Foo (x => new { Before = other + x, After = x + other });
    }

    static void Foo<T>(Func<int, T> func) {}
}

这与:

private static void Main()
{
    <>c__DisplayClass1 class2;
    class2 = new <>c__DisplayClass1();
    class2.other = "hello";
    Foo(new Func<int, <>f__AnonymousType0<string, string>>(class2.<Main>b__0));
    return;
}

然后请查阅<代码><>c__DisplayClass1和<>f_AnonymousType0,以便了解更多细节。

问题回答




相关问题
热门标签