文献翻译 C#和.NET框架 计算机专业 中英文_第1页
文献翻译 C#和.NET框架 计算机专业 中英文_第2页
文献翻译 C#和.NET框架 计算机专业 中英文_第3页
文献翻译 C#和.NET框架 计算机专业 中英文_第4页
文献翻译 C#和.NET框架 计算机专业 中英文_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、毕业设计外 文 文 献 翻 译院 系 计算机与电子系 专 业 班 级 姓 名 原 文 出 处 Illustrated C# 2008 评 分 指 导 教 师 陈颉 华中科技大学武昌分校2012年03月01日毕业设计/论文外文文献翻译要求:1外文文献翻译的内容应与毕业设计/论文课题相关。2外文文献翻译的字数:非英语专业学生应完成与毕业设计/论文课题内容相关的不少于2000汉字的外文文献翻译任务(其中,汉语言文学专业、艺术类专业不作要求),英语专业学生应完成不少于2000汉字的二外文献翻译任务。格式按华中科技大学武昌分校本科毕业设计/论文撰写规范的要求撰写。3外文文献翻译附于开题报告之后:第一部分

2、为译文,第二部分为外文文献原文,译文与原文均需单独编制页码(底端居中)并注明出处。本附件为封面,封面上不得出现页码。4外文文献翻译原文由指导教师指定,同一指导教师指导的学生不得选用相同的外文原文。C# and the .NET FrameworkThe C# programming language was designed for developing programs for Microsofts .NET Framework. This chapter will take a brief look at where .NET came from, and its basic archit

3、ecture. Just to make sure youre starting on the right foot, let me take this opportunity to remind you of what is hopefully the obvious: C# sharp is pronounced see sharp.In the late 1990s, Windows programming using the Microsoft platform had fractured into a number of branches. Most programmers were

4、 using Visual Basic (VB), C, or C+. Some C and C+ programmers were using the raw Win32 API, but most were using the Microsoft Foundation Classes (MFC). Others had moved to the Component Object Model (COM).All these technologies had their own problems. The raw Win32 API was not object-oriented, and u

5、sing it required a lot more work than MFC. MFC was object-oriented, but was inconsistent and getting old. COM, although conceptually simple, was complex in its actual coding, and required lots of ugly, inelegant plumbing.Another shortcoming of all these programming technologies was that they were ai

6、med primarily at developing code for the desktop rather than the Internet. At the time, programming for the Web was an afterthought and seemed very different from coding for the desktop.What we really needed was a new startan integrated, object-oriented development framework that would bring consist

7、ency and elegance back to programming. To meet this need, Microsoft set out to develop a code execution environment and a code development environment that met these goals.In 2002, Microsoft released the .NET Framework, which promised to address the old problems and meet the goals for the next-gener

8、ation system. The .NET Framework is a much more consistent and object-oriented environment than either the MFC or COM programming technologies. Some of its features include the following:n Multiple platforms: The system runs on a broad range of computers, from servers and desktop machines to PDAs an

9、d cell phones.n Industry standards: The system uses industry standard communication protocols, such as XML, HTTP, SOAP, and WSDL.n Security: The system can provide a much safer execution environment, even in the presence of code obtained from suspect sources.The .NET Framework is made up of three co

10、mponents. The execution environment is called the Common Language Runtime (CLR). The CLR manages program execution at run time, including the following:n Memory managementn Code safety verificationn Code executionn Garbage collectionThe programming tools include everything you need for coding and de

11、bugging, including the following:n The Visual Studio integrated development environmentn .NET-compliant compilers (e.g., C#, VB, JScript, and managed C+)n Debuggersn Server-side improvements, such as ASP.NETThe Base Class Library (BCL) is a large class library used by the .NET Framework and availabl

12、e for you to use in your programs as well.The .NET Framework offers programmers considerable improvements over previous Windows programming environments. A brief overview of its features and their benefits is given in the following sections.Object-Oriented Development EnvironmentThe CLR, the BCL, an

13、d C# are designed to be thoroughly object-oriented and act as a wellintegrated environment.The system provides a consistent, object-oriented model of programming for both local programs and distributed systems. It also provides a software development interface for desktop application programming, mo

14、bile application programming, and web development, consistent across a broad range of targets, from servers to cell phones.Automatic Garbage CollectionThe CLR has a service called the Garbage Collector (GC), which automatically manages memory for you.n The GC automatically deletes objects from memor

15、y that your program will no longer access.n The GC relieves the programmer of tasks that he or she has traditionally had to perform, such as deallocating memory and hunting for memory leaks. This is no small feature, since hunting for memory leaks can be difficult and time-consuming.Interoperability

16、The .NET Framework was designed for interoperability between different .NET languages, the operating system or Win32 DLLs, and COM.n .NET language interoperability allows software modules written using different .NET languages to interact seamlessly.A program written in one .NET language can use and

17、 even inherit from a class written in another .NET language, as long as certain rules are followed.Because of its ability to easily integrate modules produced in different programming languages, the .NET Framework is sometimes described as language agnostic.n .NET provides a feature called platform

18、invoke (P/Invoke), which allows code written for.NET to call and use code not written for .NET but exported as raw C functions by standard Win32 DLLs, such as the Windows APIs.n The .NET Framework also allows interoperability with COM. .NET software components can call COM components and COM compone

19、nts can call .NET components as if they were COM components themselves.No COM RequiredThe .NET Framework frees the programmer from the COM legacy. As a C# programmer, you do not need to use COM, and therefore do not need any of the following:n The IUnknowninterface: In COM, all objects must implemen

20、t interface IUnknown. In con-trast, all .NET objects derive from a single class called object. Interface programming is still an important part of .NET, but it is no longer the central theme.n Type libraries: In COM, type information is kept in type libraries as .tlb files, which areseparate from th

21、e executable code. In .NET, a programs type information is kept together with the code in the program file.n Reference counting: In COM, the programmer must keep track of the number of refer-ences to an object to make sure it is not deleted at the wrong time. In .NET, the GC keeps track of reference

22、s and deletes objects only when appropriate.n HRESULT: COM uses the HRESULT data type to return runtime error codes. .NET does not use HRESULTs. Instead, all unexpected runtime errors produce exceptions.n The registry: COM applications must be registered in the system registry, which holds informati

23、on about the configurations of the operating system and applications. .NET applications do not use the registrysimplifying the installation and removal of programs. Simplified DeploymentDeploying programs written for the .NET Framework can be much easier than it was before, for the following reasons

24、:n The fact that .NET programs dont need to be registered with the registry means that inthe simplest case, a program just needs to be copied to the target machine and its ready to run.n .NET offers a feature called side-by-side execution, which allows different versions of a DLL to exist on the sam

25、e machine. This means that every executable can have access to the version of the DLL for which it was built.Type SafetyThe CLR checks and ensures the type safety of parameters and other data objectseven between components written in different programming languages.The Base Class LibraryThe .NET Fra

26、mework supplies an extensive base class library, called, not surprisingly, the Base Class Library (BCL). (It is also sometimes called the Framework Class LibraryFCL). You can use this extensive set of available code when writing your own programs. Some of the categories are the following:n General b

27、ase classes: Classes that provide you with an extremely powerful set of tools fora wide range of programming tasks, such as string manipulation, security, and encryption n Collection classes: Classes that implement lists, dictionaries, hash tables, and bit arraysn Threading and synchronization class

28、es: Classes for building multithreaded programsn XML classes: Classes for creating, reading, and manipulating XML documentsC#和.NET框架C#编程语言是为开发微软公司的.NET框架上的程序而设计的。本章将简要介绍.NET从何而来,以及它的基本架构。这只是为了确保你从正确的一步开始,让我借此机会提醒你一件可能显而易见的事情:C#的发音为see sharp。在20世纪90年代后期,使用微软平台的Windows编程分化成许多分支。大多数程序员在使用Visual Basic (

29、VB)、C或C+。一些C和CH程序员在使用纯Win32 API,但大多数人在使用MFC(Microsoft Foundation Classes,微软基础类库)。其他人已经转向了COM (Component Object Model,组件对象模型)。所有的这些技术都有自己的问题。纯Win32 API不是面向对象的,而且使用它的工作量比MFC的更大。MFC是面向对象的,但是它不一致,并逐渐变得陈旧。COM虽然概念上简单,但它的实际代码复杂,并且需要很多丑陋的、不雅的底层基础代码。所有这些编程技术的另外一个缺点是它们主要针对桌面程序而不是Internet的开发。那时,Web编程还是以后的事情,而且

30、看起来和桌面编程非常不同。我们真正需要的是一个新的开始个集成的、面向对象的开发框架,它可以把一致和优雅带回编程。为满足这个需求,微软宣布开发一个代码执行环境和一个可以实现这些目标的代码开发环境。在2002年,微软发布了.NET框架,声称其解决了旧问题并实现了下一代系统的目标。.NET框架是一种比MFC或COM编程技术更一致并面向对象的环境。它的特点包括以下几点。n 多平台:该系统可以在广泛的计算机上运行,包括从服务器、桌面机到PDA和移动 。n 行业标准:该系统使用行业标准的通信协议,比如XML、HTTP、SOAP和WSDL。n 安全性:该系统能提供更加安全的执行环境,即使有来源可疑的代码存在

31、。 .NET框架由三部分组成执行环境称为CLR(Common Language Runtime,公共语言运行库)。CLR在运行期管理程序的执行,包括以下内容。n 内存管理n 代码安全验证n 代码执行n 垃圾收集 编程工具涵盖了编码和调试需要的一切,包括:n .NET兼容的编译器(例如:C#、VB、JScript和托管的C+)n 调试器n 服务器端改进,比如ASP.NETBCL(Base Class Library基类库)是.NET框架使用的一个大的类库,而且也可以在你的程序中使用。较之以前的Windows编程环境,.NET框架为程序员带来了相当大的改进。下面的几节将简要阐述它的特点及其带来的好

32、处。面向对象的开发环境CLR、BCL和C#被设计得完全面向对象,并形成良好的集成环境。系统为本地程序和分布式系统都提供了一致的、面向对象的编程模型。它还为桌面应用程序、移动应用程序和Web开发提供了软件开发接口,涉及的对象范围很广,从计算机服务器到手机。自动垃圾收集CLR有一项服务称为GC(Garbage Collector,垃圾收集),它能为你自动管理内存。n GC自动从内存中删除程序不再访问的对象。n GC使程序员不再操心许多以前必须执行的任务,比如释放内存和检查内存泄漏。这可不是个小特性,因为检查内存泄漏可能非常困难而且耗时。互操作性.NET框架的设计专门考虑了不同的.NET语言、操作系统或Win32 DLL

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论