<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JUST DO IT ~

    我只想當個程序員

    c# 編譯指令 簡單使用 --- 技巧 可以參考 vs 的編譯語句..查看情況


    csc 編譯的情況

     

    輸出成lib
    csc /t:library /out:A.dll a.cs

     

    編譯另外一個文件 引用dll

    csc /r:acme.dll Test.cs


    D:\c_\1>MyTest.exe
    X value = 123

    D:\c_\1>csc /t:library /out:A.dll a.cs
    Microsoft (R) Visual C# 2005 編譯器 版本 8.00.50727.42
    用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
    版權所有 (C) Microsoft Corporation 2001-2005。保留所有權利。


    D:\c_\1>csc /r:A.dll MyTest.cs
    Microsoft (R) Visual C# 2005 編譯器 版本 8.00.50727.42
    用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
    版權所有 (C) Microsoft Corporation 2001-2005。保留所有權利。


    D:\c_\1>MyTest.exe
    X value = 123

    D:\c_\1>











    編譯成類庫 

    csc /t:library acme.cs
     

    將此示例編譯為一個庫沒有Main入口點的代碼),并產生一個名為acme.dll的程序集。



     

    如果此程序存儲在文件test.cs那么在編譯test.cs可以使用編譯器的/r選項引用acme.dll程序集

    csc /r:acme.dll test.cs







    C:\Documents and Settings\gddg>csc /?
    Microsoft (R) Visual C# 2005 編譯器 版本 8.00.50727.42
    用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
    版權所有 (C) Microsoft Corporation 2001-2005。保留所有權利。

                          Visual C# 2005 編譯器選項

                            - 輸出文件 -
    /out:<file>                   指定輸出文件名(默認值:
                                  包含主類的文件或第一個文件的基名稱)
    /target:exe                   生成控制臺可執行文件(默認) (縮寫: /t:exe)
    /target:winexe                生成 Windows 可執行文件 (縮寫: /t:winexe)
    /target:library               生成庫 (縮寫: /t:library)
    /target:module                生成能添加到其他程序集的模塊 (縮寫: /t:module)
    /delaysign[+|-]               僅使用強名稱密鑰的公共部分對程序集進行延遲簽名
    /doc:<file>                   要生成的 XML 文檔文件
    /keyfile:<file>               指定強名稱密鑰文件
    /keycontainer:<string>        指定強名稱密鑰容器
    /platform:<string>            限制可以在其上運行此代碼的平臺: x86、Itanium、x64
                                  或 anycpu。默認值為 anycpu。

                            - 輸入文件 -
    /recurse:<wildcard>           根據通配符規范,包括當前目錄和子目錄下的所有文件
    /reference:<alias>=<file>     使用給定的別名從指定的程序集文件引用元數據 (縮寫:
                                  /r)
    /reference:<file list>        從指定的程序集文件引用元數據 (縮寫: /r)
    /addmodule:<file list>        將指定的模塊鏈接到此程序集中

                            - 資源 -
    /win32res:<file>              指定 Win32 資源文件(.res)
    /win32icon:<file>             使用該圖標輸出
    /resource:<resinfo>           嵌入指定的資源 (縮寫: /res)
    /linkresource:<resinfo>       將指定的資源鏈接到此程序集 (縮寫: /linkres)
                                  其中 resinfo 的格式是 <file>[,<string
    name>[,public|private]]

                            - 代碼生成 -
    /debug[+|-]                   發出調試信息
    /debug:{full|pdbonly}         指定調試類型(“full”是默認類型,可以將調試程序附
                                  加到正在運行的程序)
    /optimize[+|-]                啟用優化 (縮寫: /o)

                            - 錯誤和警告 -
    /warnaserror[+|-]             將所有警告報告為錯誤
    /warnaserror[+|-]:<warn list> 將特定警告報告為錯誤
    /warn:<n>                     設置警告等級(0-4) (縮寫: /w)
    /nowarn:<warn list>           禁用特定的警告消息

                            - 語言 -
    /checked[+|-]                 生成溢出檢查
    /unsafe[+|-]                  允許“不安全”代碼
    /define:<symbol list>         定義條件編譯符號 (縮寫: /d)
    /langversion:<string>         指定語言版本模式: ISO-1 或 Default

                            - 雜項 -
    @<file>                       有關更多選項,請閱讀響應文件
    /help                         顯示此用法信息 (縮寫: /?)
    /nologo                       取消編譯器版權信息
    /noconfig                     不要自動包含 CSC.RSP 文件

                            - 高級 -
    /baseaddress:<address>        要生成的庫的基址
    /bugreport:<file>             創建“Bug 報告”文件。
    /codepage:<n>                 指定打開源文件時要使用的代碼頁
    /utf8output                   以 UTF-8 編碼格式輸出編譯器消息
    /main:<type>                  指定包含入口點的類型(忽略所有其他可能的入口點)
                                  (縮寫: /m)
    /fullpaths                    編譯器生成完全限定路徑
    /filealign:<n>                指定用于輸出文件節的對齊方式
    /pdb:<file>                   指定調試信息文件名(默認值: 擴展名為 .pdb
                                  的輸出文件名)
    /nostdlib[+|-]                不引用標準庫(mscorlib.dll)
    /lib:<file list>              指定要在其中搜索引用的附加目錄
    /errorreport:<string>         指定如何處理內部編譯器錯誤: prompt、send、queue 或
                                  none。默認值為 queue。
    /moduleassemblyname:<string>  此模塊所屬程序集的名稱。


    C:\Documents and Settings\gddg>

     

     

     

     

     

     

     

     

     資源文件編譯近  執行文件

     

     

    /*
    Perform the following steps to use this code example:

    Main assembly:
    1) In a main directory, create a file named "rmc.txt" that
    contains the following resource strings:

    day=Friday
    year=2006
    holiday="Cinco de Mayo"

    2) Use the resgen.exe tool to generate the "rmc.resources"
    resource file from the "rmc.txt" input file.

    > resgen rmc.txt

    D:\c_\resx_資源文件編輯>"C:\Program Files\Microsoft Visual Studio 8\SmartDevices
    \SDK\SDKTools\resgen" rmc.txt
    Read in 4 resources from 'rmc.txt'
    Writing resource file...  Done.


    Satellite Assembly:
    3) Create a subdirectory of the main directory and name the
    subdirectory "es-ES", which is the culture name of the
    satellite assembly.

    4) Create a file named "rmc.es-ES.txt" that contains the
    following resource strings:

    day=Viernes
    year=2006
    holiday="Cinco de Mayo"

    5) Use the resgen.exe tool to generate the "rmc.es-ES.resources"
    resource file from the "rmc.es-ES.txt" input file.

    > resgen rmc.es-ES.txt

    6) Use the al.exe tool to create a satellite assembly. If the
    base name of the application is "rmc", the satellite assembly
    name must be "rmc.resources.dll". Also, specify the culture,
    which is es-ES.

    > al /embed:rmc.es-ES.resources /c:es-ES /out:rmc.resources.dll

    7) Assume the filename for this code example is "rmc.cs". Compile
    rmc.cs and embed the main assembly resource file, rmc.resources, in
    the executable assembly, rmc.exe:

    >csc /res:rmc.resources rmc.cs

    8) Execute rmc.exe, which obtains and displays the embedded
    resource strings.
    */

     

     

     

    D:\c_\resx_資源文件編輯\test2>csc /res:rmc.resources /res:rmc.es-ES.resources  r
    mc.cs
    Microsoft (R) Visual C# 2005 編譯器 版本 8.00.50727.1433
    用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
    版權所有 (C) Microsoft Corporation 2001-2005。保留所有權利。


    D:\c_\resx_資源文件編輯\test2>rmc
    Obtain resources using the current UI culture.
    "Cinco de Mayo" will occur on Friday in 2006.

    資源文件名稱 rmc
    Obtain resources using the es-ES culture.
    "Cinco de Mayo" will occur on Friday in 2006.


    D:\c_\resx_資源文件編輯\test2>dir
     驅動器 D 中的卷沒有標簽。
     卷的序列號是 04BF-7EB7

     D:\c_\resx_資源文件編輯\test2 的目錄

    2008-09-23  07:45    <DIR>          .
    2008-09-23  07:45    <DIR>          ..
    2008-09-23  06:50               318 rmc.es-ES.resources
    2008-09-23  07:15             4,338 rmc.cs
    2008-09-23  06:53               323 rmc.resources
    2008-09-23  08:01             4,608 rmc.exe
                   4 個文件          9,587 字節
                   2 個目錄  2,158,411,776 可用字節

     

     

     

     

     

     


    D:\c_\resx_資源文件編輯\test2>csc /res:rmc.resources /res:rmc.es-ES.resources  r
    mc.cs
    Microsoft (R) Visual C# 2005 編譯器 版本 8.00.50727.1433
    用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
    版權所有 (C) Microsoft Corporation 2001-2005。保留所有權利。


    D:\c_\resx_資源文件編輯\test2>rmc
    Obtain resources using the current UI culture.
    "Cinco de Mayo" will occur on Friday in 2006.

    資源文件名稱 rmc.es-ES
    Obtain resources using the es-ES culture.
    "Cinco de Mayo" will occur on Viernes in 2006.

     

     


     




    posted on 2008-02-07 16:32 小高 閱讀(968) 評論(0)  編輯  收藏 所屬分類: DotNet

    導航

    <2008年2月>
    272829303112
    3456789
    10111213141516
    17181920212223
    2425262728291
    2345678

    統計

    常用鏈接

    留言簿(3)

    隨筆分類(352)

    收藏夾(19)

    關注的blog

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 日韩精品无码免费专区网站| 一边摸一边桶一边脱免费视频| 精品国产免费人成电影在线观看| 亚洲精品乱码久久久久久| 香蕉免费看一区二区三区| 亚洲中文字幕不卡无码| 成人电影在线免费观看| 亚洲精品国产品国语在线| 国产一区二区三区免费| 亚洲黄色免费在线观看| 亚色九九九全国免费视频| 国产亚洲中文日本不卡二区| 久久这里只有精品国产免费10| 亚洲精品中文字幕| 亚洲福利精品一区二区三区| japanese色国产在线看免费| 色久悠悠婷婷综合在线亚洲| 麻豆精品成人免费国产片| 亚洲国产综合人成综合网站00| 日韩精品无码区免费专区 | 欧洲精品成人免费视频在线观看 | 亚洲av无码专区在线观看下载 | 亚洲日韩一页精品发布| AAA日本高清在线播放免费观看| 久久久久亚洲av无码专区喷水| 美女视频黄免费亚洲| 亚洲aⅴ无码专区在线观看| 亚洲不卡无码av中文字幕| 三上悠亚电影全集免费| 亚洲黄色在线视频| 免费网站看v片在线香蕉| 亚美影视免费在线观看| 亚洲精品欧洲精品| 国产免费黄色大片| 日韩人妻无码精品久久免费一| 2019亚洲午夜无码天堂| 精品国产亚洲一区二区在线观看 | 久久福利青草精品资源站免费| 久久精品国产亚洲av高清漫画| 免费鲁丝片一级观看| 国产免费网站看v片在线|