【正文】
運(yùn)行時(shí)類型的聲明性元數(shù)據(jù)。 ? 內(nèi)聯(lián) XML 文檔注釋。 在 C 中,如果需要與其他 Windows 軟件(如 COM 對(duì)象或本機(jī) Win32 DLL)交互,可以通過(guò)一個(gè)稱為 “Interop” 的過(guò)程來(lái)實(shí)現(xiàn)?;ゲ僮魇? C 程序能夠完成本 機(jī) C++ 應(yīng)用程序可以完成的幾乎任何任務(wù)。在直接內(nèi)存訪問(wèn)必不可少的情況下, C 甚至支持指針和 “ 不安全 ” 代碼的概念。 C 的生成過(guò)程比 C 和 C++ 簡(jiǎn)單,比 Java 更為靈活。沒有單獨(dú)的頭文件,也不要求按照特定順序聲明方法和類型。 C 源文件可以定義任意數(shù)量的類、結(jié)構(gòu)、接口和事件。 C 程序在 .NET Framework 上運(yùn)行,它是 Windows 的一個(gè)必要組件,包括一個(gè)稱為公共語(yǔ)言運(yùn)行時(shí) (CLR) 的虛擬執(zhí)行系統(tǒng)和一組統(tǒng)一的類庫(kù)。 CLR 是 Microsoft 的公共語(yǔ)言基礎(chǔ)結(jié)構(gòu) (CLI) 的一個(gè)商業(yè)實(shí)現(xiàn)。 CLI 是一種國(guó)際標(biāo)準(zhǔn),是用于創(chuàng)建語(yǔ)言和庫(kù)在其中無(wú)縫協(xié)同工作的執(zhí)行和開發(fā)環(huán)境的基礎(chǔ)。 用 C 編寫的源代碼被編譯為一種符合 CLI 規(guī)范的中間語(yǔ)言 (IL)。 IL 代碼與資源(如位圖和字符串)一起作為一種稱為程序集的可執(zhí)行文件存儲(chǔ)在磁盤上,通常具有的擴(kuò)展名為 .exe 或 .dll。程序集包含清單,它提供關(guān)于程序集的類型、版本、區(qū)域性和安全要求等信息。 執(zhí)行 C 程序時(shí),程序集將加載到 CLR 中,這可能會(huì)根據(jù)清單中的信息執(zhí)行不同的操作。然后,如果符合安全要求, CLR 執(zhí)行實(shí)時(shí) (JIT) 編譯以將 IL 代碼轉(zhuǎn)換為本機(jī)機(jī)器指令。 CLR 還提供與自動(dòng)垃圾回收、異常處理和資源管理有關(guān)第 6 頁(yè) 共 14 頁(yè) 的其他服務(wù)。由 CLR 執(zhí)行的代碼有時(shí)稱為 “ 托管代碼 ” ,它與編譯為面向特定系統(tǒng)的本機(jī)機(jī)器語(yǔ)言的 “ 非托管代碼 ” 相對(duì)應(yīng)。下圖演示了 C 源代碼文件、基類庫(kù)、程序集和 CLR 的編譯時(shí)與運(yùn)行時(shí)的關(guān)系。 語(yǔ)言互操作性是 .NET Framework 的一個(gè)關(guān)鍵功能。因?yàn)橛? C 編譯器生成的 IL 代碼符合公共類型規(guī)范 (CTS),因此從 C 生成的 IL 代碼可以與從 Visual Basic、 Visual C++、 Visual J 的 .NET 版本或者其他 20 多種符合 CTS 的語(yǔ)言中的任何一種生成的代碼進(jìn)行交互。單一程序集可能包含用不同 .NET 語(yǔ)言編寫的多個(gè)模塊,并且類型可以相互引用,就像它們是用同一種語(yǔ)言編寫的。 除了運(yùn) 行時(shí)服務(wù), .NET Framework 還包含一個(gè)由 4000 多個(gè)類組成的內(nèi)容詳盡的庫(kù),這些類被組織為命名空間,為從文件輸入和輸出到字符串操作、到 XML 分析、到 Windows 窗體控件的所有內(nèi)容提供多種有用的功能。典型的 C 應(yīng)用程序使用 .NET Framework 類庫(kù)廣泛地處理常見的 “ 日常 ” 任務(wù)。 第 7 頁(yè) 共 14 頁(yè) is a unified Web development model that includes the services necessary for you to build enterpriseclass Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language patible with the mon language runtime (CLR), including Microsoft Visual Basic, C, JScript .NET, and J. These languages enable you to develop applications that benefit from the mon language runtime, type safety, inheritance, and so on. includes: ? A page and controls framework ? The piler ? Security infrastructure ? Statemanagement facilities ? Application configuration ? Health monitoring and performance features ? Debugging support ? An XML Web services framework ? Extensible hosting environment and application life cycle management ? An extensible designer environment The page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. As a rule, you can use the same page for multiple browsers, because renders the appropriate markup for the browser making the request. However, you can design 第 8 頁(yè) 共 14 頁(yè) your Web page to target a specific browser, such as Microsoft Inter Explorer 6, and take advantage of the features of that browser. supports mobile controls for Webenabled devices such as cellular phones, handheld puters, and personal digital assistants (PDAs). Web pages are pletely objectoriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Webbased applications by presenting a unified model for responding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle. The page and controls framework also enables you to encapsulate mon UI functionality in easytouse, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering. The page and controls framework also provides features to control the overall look and feel of your Web