您的位置:首页 > 编程语言 > C#

Inside c#_Chapter1(01)

2004-11-21 16:59 423 查看
(原文)[/b]

Part I[/b]

C# Class Fundamentals[/b]

Chapter 1[/b]

Building C# Applications and Libraries[/b]

In the first edition of Inside C# (Microsoft Press, 2001), the first two chapters gave an overview of object-oriented programming and the .NET environment. While this seemed like a good idea at the time, it meant that you, the reader/programmer, didn't write code until Chapter 3. Since that book was published, I've been fortunate enough to give several talks and teach a few classes on .NET and C# programming. That experience has taught me an important lesson: programmers don't want lectures-they want code! Therefore, I'm taking a slightly different approach with this edition of the book. Instead of starting with "lay of the land" chapters, I'm going to jump right into programming with C#. I'll then explain the different architectural aspects of .NET as I explain the syntax of C# as you work your way through the demo applications. Another major departure from the style of the first edition is that after explaining a given topic or language feature at the C# level, I'll sometimes dive into the nitty-gritty details of how that feature is implemented at the lowest level that we applications programmers can access-the Microsoft intermediate language (MSIL) level.

Let's begin by writing a "Hello, World" application and building and running it from the command line. From there, you'll learn how the .NET version of "Hello, World" works under the covers and how it?s executed within the .NET Framework. Once we’ve gone over that, you'll then write the same application by using Microsoft Visual Studio to see how that development environment can make your programming life much simpler. (You don't need Visual Studio .NET to work through most of the examples in this book. However, all the examples in this book were created with this tool.) From there, I'll go into a bit of depth on the internals of a .NET application, what a just-in-time compiler (JITter) is, and how .NET applications are loaded and executed under Microsoft Windows. Finally, the chapter wraps up with a full section on assemblies?what they are, what benefits they provide, and how to build them?and how to create both .NET modules and dynamic-link libraries (DLLs) for multifile applications.

(译文)

第[/b]1[/b]部分[/b][/b]

C# [/b]类基础知识[/b][/b]

第[/b] 1 [/b]章[/b] [/b]创建[/b]C#[/b]应用程序和库[/b][/b]

在Inside C#的第一版(微软出版社,2001), 开头两章给出了一个关于面向对象程序设计和.NET环境的概览。 在当时这是一个好主意,这意味着,一个读者或程序员,在开始第3章前不用写任何代码。 自从那本书出版后,我非常幸运的针对.Net和C#程序设计开了几个讲座和讲授了几个课程。 这一经历告诉我一个非常重要的经验: 程序员不需要说教,他们需要代码! 因此,我对这一版本做了轻微的调整以接近这一目标。 用“Lay of land(脚踏实地)”的章节代替,我将直接进入C#程序设计部分。接下来通过一个C#的示例应用程序我将阐释C#的语法和.NET不同于其它的体系架构。有别于第一版将其放在阐明了一个给定的主题或C#语言级的语言特性之后的风格,我将经常在我们应用程序设计者能够接触到的微软中间语言(MSIL)这一层级深入地探讨语言特性在本质上是如何实现的细节。

让我们开始编写 "Hello , World!" 应用程序并且通过命令行编译和运行它。 从中,你将会学习到 .NET版本的"Hello , World!" 在表层是如何工作的和它是如何在.NET框架下被执行的。 一旦我们理解了它,你将会发现Microsoft Visual studio.NET会把你编写同样应用程序的工作变得如此简单。(本书中的大部分例程你并不需要使用Visual Studio .NET,但是本书的所有例程都是使用这一工具创建的)在这里,我会稍微的深入.NET的内部,去讨论什么是即时编译器(just-in-time compiler JITter)和.NET应用程序是如何在Microsoft Windws中是被装载和执行的。最后,一个完整的小节讲述什么是程序集,它能带来什么益处和如何去创建它,以及如何从多个文件组成的应用程序去创建.NET模块和动态链接库(DLLs)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: