讀經典——《CLR via C#》(Jeffrey Richter著) 筆記_通過ILDasm.exe查看編譯器如何將類型及其成員編譯成中繼資料

來源:互聯網
上載者:User

標籤:

【執行個體代碼】

using System;public sealed class SomeType                          //-------------1{    //嵌套類    private class SomeNestedType{}                      //-------------2    //常量、唯讀欄位和靜態可讀/可寫欄位    private const Int32 SomeConstant = 1;             //-------------3    private readonly Int32 SomeReadOnlyField = 2;      //-------------4    private static Int32 SomeReadWriteField = 3;      //-------------5    //類型構造器    static SomeType(){}                                  //-------------6    //執行個體構造器    public SomeType(Int32 x){}                          //-------------7    public SomeType(){}                               //-------------8    //執行個體方法和靜態方法    private String InstanceMethod(){return null;}     //-------------9    public static void Main(){}                       //-------------10    //執行個體屬性    public Int32 SomeProp                             //-------------11    {        get{return 0;}                                //-------------12        set{}                                         //-------------13    }     //執行個體有參屬性(索引器)    public Int32 this[String s]                       //-------------14    {        get{return 0;}                                //-------------15        set{}                                         //-------------16    }    //執行個體事件    public event EventHandler SomeEvent;               //-------------17}

【ILDasm.exe 查看上文代碼編譯的中繼資料】

下面這個是書上的,序號對應著看就行

讀經典——《CLR via C#》(Jeffrey Richter著) 筆記_通過ILDasm.exe查看編譯器如何將類型及其成員編譯成中繼資料

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.