<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

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲无人区码一二三码区别图片 | 亚洲裸男gv网站| 亚洲国产精品自在自线观看| 四虎在线免费视频| 国产成人亚洲合集青青草原精品| 啦啦啦完整版免费视频在线观看| 亚洲视频在线观看网站| 永久黄色免费网站| 色偷偷亚洲女人天堂观看欧| 最近中文字幕mv免费高清视频7| 亚洲三级在线观看| 日本v片免费一区二区三区| 精品亚洲成a人在线观看| 国产一区二区三区在线免费 | 亚洲av中文无码乱人伦在线观看| 永久黄网站色视频免费| 老司机午夜精品视频在线观看免费 | 久久精品亚洲日本佐佐木明希| 无人在线观看免费高清| 亚洲女人影院想要爱| 全免费a级毛片免费看不卡| 国产亚洲福利精品一区二区| 国产精品亚洲玖玖玖在线观看| 丝瓜app免费下载网址进入ios| 久久久久亚洲av无码专区导航| 99热在线精品免费全部my| 色屁屁www影院免费观看视频| 亚洲人成影院在线无码按摩店| 120秒男女动态视频免费| 国产精品亚洲lv粉色| 伊人久久大香线蕉亚洲五月天 | 亚洲剧场午夜在线观看| 国产精品免费小视频| 成人电影在线免费观看| 亚洲人成7777| 亚洲色欲久久久综合网东京热| 1000部夫妻午夜免费| 特级毛片A级毛片100免费播放| 久久精品国产亚洲av四虎| 国产成人无码免费视频97| 无码人妻一区二区三区免费看|