C#基础介绍外文翻译_第1页
C#基础介绍外文翻译_第2页
C#基础介绍外文翻译_第3页
C#基础介绍外文翻译_第4页
C#基础介绍外文翻译_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

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

文档简介

1、本科毕业设计(论文)外文翻译本科毕业设计(论文)外文翻译译文:c#基础介绍c#是一种简单,现代,面向对象和类型安全的编程语言,由c和c+发展而来。c#牢固地植根于c和c+语言族谱种,并且会很快被c和c+程序员所熟悉。c#的目标在于把visual basic的高生产力和c+本身的能力结合起来。c#作为microsoft visual studio 7.0的一部分提供给用户。除了c#以外,visual studio还支持visual basic,visual+和描述语言vbscript和jscript.所有这些语言都提供对microsoft.net 平台的访问能力,它包括一个通用的执行引擎和一个丰

2、富的类库。microsoft.net平台定义了一个“通用语言子集”(cls),是一种混合语言,它可以增强cls兼容语言和类库间的无缝协同工作能力。对于c#开发者,这意味着既是c#是一种新的语言,它已经可以对用老牌工具如visual basic和visual c+使用的丰富类库进行完全访问。c#子集并没有包含一个类库。一个c#程序由一个或多个源文件组成。一个源文件是一个统一字符编码的字符的有序序列。燕文件通常和文件系统种的文件有一一对应关系,但是这个对应关系并不需要。从概念来讲,一个程序在编译时有四步:1. 预处理,一种文本到文本的转换,这使得可以对程度需文本进行条件饱和和删除。2. 语法分析,

3、它把输入字符序列转换为一个标记序列。3. 句法分析,它把标记序列转换为可执行代码。c#的词汇和句子的文法散步在整个文章中。词汇文法定义如能把字符组合为形式标记:句子的文法定义了如何把标记组合为c#程序。文法生成包括无词尾符号和有词尾符号。在文法生成当中,无词尾符号用意大利体表示,而有词尾符号用定宽字体。每一个吴词尾符号定义为一系列产品(production)。这一系列产品的第一行是吴词尾符号的名称,接下来是一个冒号。对于一个场频,每个连续的锯齿状的行的右手边同左手边类似是无词尾符号。c#程序中的生命定义了程序的重要声明。c#程序用名称空间来组织,它可以包含类型声明和潜逃声明。类型声明用来定义类

4、,结构,接口,类的声明可以包含实例构造函数,析构函数,静态构造函数,常数,域,方法,属性,时间,索引,操作符和潜逃类型。一个声明在声明所属的声明域定义了一个名称。除了重载构造函数,方法,索引和操作符名称,在一个声明域种有两个或更多介绍有相同名称成员的声明时,是错误的。对一个而生命域中,包含有相同名称的不同种类成员是永远不可能的。例如,一个声明域种不能包括有相同名称的域和方法。这里有许多种不同类型的声明域,如下表示:在所有程序的源文件种,不包括嵌套名称空间声明的名称空间成员声明都是一个单独的组合声明域,称为全局声明域。在所有程序的源文件种,名称空间成员声明和有相同完整正确的名称空间名称的名称空间

5、声明都是一个单独的组合声明域。每个类,结构或接口声明都会创建一个新的声明域。名称通过类成员声明,结构成员什么或接口成员声明介绍到这个声明域中。除了重载构造函数声明和静态构造函数声明,一个类类或结构成员声明不能引入域类或结构名称相同的成员。一个类,节后或接口允许方法和所以的重载。此外,一个类声明的方法,而在他们各自签名中提供了不同的方法声明。注意基类不影响类的声明域。而基本接口不影响一个接口的声明域。这样,一个派生的类或接口可以用和继承的成员相同的名称声明一个成员。这样的一个成员贝成为隐藏了继承的成员。每个枚举声明创建一个新的声明域。名称通过枚举成员声明介绍到声明域中。每个块或者转换为局部变量创

6、建一个分立声明域。名称通过局部变量声明贝引入到这个声明域。如果一个块是构造函数或方法声明的主体,在形参列表中声明的参数是这2个块的局部变量声明域的成员。块的局部变量声明域包括任何嵌套块。因而,在一个嵌套块中不太可能用域嵌套块中的局部变量有相同名称声明一个局部变量每个块或转换块为标签创建一个分立的声明域。名称通过标签声明贝引入到这个声明域,而名称通过goto声明引入到这2个声明域。块的局部变量声明域包括任何嵌套块。因而,在一个嵌套块中不太可能用域嵌套块中的标签想同名称声明一个标签。在名称贝声明的文本顺序通常并不重要。特别是,文本顺序对于声明和使用名称空间,类型,常数,方法,属性,时间,索引,操作

7、符,构造函数,析构函数和静态构造函数来说并不重要。声明顺序在下面的途径才是重要的:·域声明和局部变量的声明顺序决定了他们的初始化是按声明顺序执行。·局部变量必须在他们被使用前定义。·当常数表达式数值贝忽略,枚举成员的声明顺序是重要的。c#语言的类型被分为三类:数值类型,引用类型和指针类型。 type: value-type reference-type pointer-type指针类型只能用在不安全代码。数值类型与引用类型所不同的是,数值类型变量直接含有他们的数据,然而引用类型的变量存储对他们的数据的引用,就是后面要接受的对象。独语引用类型,可能会出现两个变量引用

8、相同对象的情况,这样对于一个变量的操作就有可能影响到由其他变量引用的对象。对于数值类型,每个变量都有他们自己对数据的拷贝,这样就不能能出现一个对变量的操作影响到另外一个的情况。c#的类型系统是统一的,这样任何类型的数据都可以贝看作对象。c#中的任何类型都直接或简介地从bojiect类类型派生,而object是所有类型的最基本类。引用类型的数值贝看作通过对象,这些对象通过把数值看作类型对象来简化。数值类型的数值通过包装和解包装操作来贝当作对象。变量代表数据的实际存储位置。每各变量所能存储的数值由它本省的类型决定。c+语言是一种类项安全语言(tsl),而且c+编译器保证每一个数值贝保存在相应的变量

9、中。变量的数值可以通过赋值或者+或-运算符改变。在变量贝赋值以前,变量自身的类型必须贝明确的声明。变量或者贝初始化的或者未初始化的。一个初始化的变量在贝定义时贝赋予了一个确定的初始值,而未初始化的变量在定义时并未贝赋予确定的初始值。对于一个在程序某处贝认为具有确定数值的iua,必然在指向这一位置的所有可能的执行路径上存在赋值操作。c#语言的大多数都使得程序员可以制定关于在程序中定义的实体的公开的消息。例如,一个类中的一个方法的可访问性,可以通过用方法修饰符public,protected,internal和private对它进行修饰来制定。c#使得程序员可以创造声明信息的新的种类,来为各种程序

10、实体指定声明信息,并且在运行时环境中找回属性信息。例如,一个框架也许定义了一个helpattribute属性,它可以被放在例如类和方法的程序元素种类来提供从程序元素到他们的文档的映射。声明信息的新种类通过属性类的声明来定义,它可能有位置的和名称的参数。声明信息使用属性来指定c#程序,并且可以在运行是作为属性实例来检索。visual c#.net.net首先是一个开发平台,它定义了一种公用语言子集(common language subsct,cls),这是一种为符合其规范的语言与类库之间提供无缝集成的混合语。.net统一了编程类库,提供了对下一代多络通信标准,可扩展标记语言(extensibl

11、e markup language,xml)的完全支持,使应用程序的开发变得更容易更简单.microsoft.net计划还将实现人机交互方面的革命,微软将在其软件中添加手写和语音识别的功能,让人们能够与计算机进行更好的交流,并在此基础上继续扩展功能,增加对各种用户终端的支持能力。最为重要的,.net将改变因特网的行为方式:软件将变成为服务。与microsoft的其它产品一样,.net与windows平台紧密集成,并且与其它微软产品相比它更进一步:由于其运行库已经与操作系统融合在了一起,从广义上把它称为一个运行库也不为过。简而言之,.net是一种面向网络、支持各种用户终端的开发平台环境。微软的宏

12、伟目标是让misrosoft.net彻底改变软件的开发方式、发行方式、使用方式等等,并且不止是针对微软一家,而是面向所有开发商与运营商!.net的核心内容之一就是要搭建第三代因特网平台,这个网络平台将解决网站之间的协同合作问题,从而是最大限度地获取信息。在.net平台上,不同网站之间通过相关的协定联系在一起,网站之间形成自动交流,协同工作,提供最全面的服务。c#既具有c+语言功能强大、灵活,又具有vb的简单易学、高效的优点,利用它可以方便快捷地开发基于文字处理、图开图像、数据库、多媒体、网络的windows应用程序和web应用程序,它对于迅速崛起的xml和web service也提供了全方位的

13、支持。因此,越来越多的人选择它作为程序设计语言。 可视化编程:用传统程序设计语言设计程序时,都是通过编写程序代码来设计用户界面,在设计过程中看不到界面的实际显示效果,必须编译后运行程序才能观察。如果对界面的效果不满意,还要回到程序中修改。有时候,这种编程-编译-修改的操作可能要反复多次,大大影响了软件开发效率。microsoft visual studio 2005提供了可视化设计工具,把windows界面设计的复杂性“封装”起来,开发人员不必为界面设计而编写大量程序代码。只需要按设计要求的屏幕布局,用系统提供的工具,在屏幕上画出各种“部件”,即图形对象,并设置这些图形对象的属性。micros

14、oft visual studio 2005自动产生界面设计代码,程序设计人员只需要编写实现程序功能的那部分代码,从而可以大大提高程序设计的效率。 面向对象的程序设计microsoft visual studio 2005支持面向对象的程序设计,但它与一般的面向对象的程序设计语言(c+)不完全相同。在一般的面向对象程序设计语言中,对象由程序代码和数据组成,是抽象的概念;而microsoft visual studio 2005则是应用面向对象的程序设计方法,把程序和数据封装起来作为一个对象,并为每个对象赋予应有的属性,使对象成为实在的东西。在设计对象时,不必编写建立和描述每个对象的程序代码,而

15、是用工具画在界面上,microsoft visual studio 2005自动生成对象的程序代码并封装起来。每个对象以图形方式显示在界面上,都是可视的。.1.2系统的功能简介本系统主要可以实现以下的管理功能:读者管理、流通管理、图书管理、系统管理等等。(1) 项目规划图书馆管理系统是一个典型的数据库应用程序,由系统管理、读者管理、流通管理、图书管理等模块组成,特规划如下:(2)系统管理模块该模块的主要任务是维护系统的正常运行和安全性设置,包括新图书管理员的添加、修改密码、照片的添加等等。(3)读者管理模块该模块的功能是实现对读者类别的设置、读者档案的管理、借书证挂失与恢复以及过期续证管理。(

16、4)流通管理模块该模块的主要功能是对图书的借阅、归还、逾期清单和过期后罚款的一些管理。(5)图书管理模块该模块的主要功能有:图书类别设置、图书档案管理、出版社管理、图书注销、图书征定、图书验收、图书盘点等对图书的管理。 (6)系统开发的目标图书馆管理系统总的实现目标是:建立以馆藏目录为基础的书目数据库;实现馆内采购、编目、流通、文献检索等信息化管理;建立图书馆动态网站;接入校园网为广大师生及时提供馆内的最新信息。长期的目标还要实现直接浏览电子图书以及馆际间的图书互借等。.欢迎转载,但请保留出处,本文章转自华软源码,原文链接:原文:c# basic introductionfrom <c#

17、 language reference>written by anders hejlsberg and scott wiltamuthc# is a simple, modern, object oriented, and type-safe programming language derived from c and c+. c# (pronounced “c sharp”) is firmly planted in the c and c+ family tree of languages, and will immediately be familiar to c and c+

18、programmers. c# aims to combine the high productivity of visual basic and the raw power of c+.here i will introduce some important serise numbers to explain the c#.c# is provided as a part of microsoft visual studio 7.0. in addition to c#, visual studio supports visual basic, visual c+, and the scri

19、pting languages vbscript and jscript. all of these languages provide access to the next generation windows services (nwgs) platform, which includes a common execution engine and a rich class library. the .net software development kit defines a "common language subset" (cls), a sort of ling

20、ua franca that ensures seamless interoperability between cls-compliant languages and class libraries. for c# developers, this means that even though c# is a new language, it has complete access to the same rich class libraries that are used by seasoned tools such as visual basic and visual c+. c# it

21、self does not include a class library.a c# program consists of one or more source files. a source file is an ordered sequence of unicode characters. source files typically have a one-to-one correspondence with files in a file system, but this correspondence is not required by c#.conceptually speakin

22、g, a program is compiled using four steps:pre-processing, a text-to-text translation that enables conditional inclusion and exclusion of program text.lexical analysis, which translates a stream of input characters into a stream of tokens. syntactic analysis, which translates the stream of tokens int

23、o executable code.lexical and syntactic grammars for c# are interspersed throughout this specification. the lexical grammar defines how characters can be combined to form tokens; the syntactic grammar defines how tokens can be combined to form c# programs.grammar productions include non-terminal sym

24、bols and terminal symbols. in grammar productions, non-terminal symbols are shown in italic type, and terminal symbols are shown in a fixed-width font. each non-terminal is defined by a set of productions. the first line of a set of productions is the name of the non-terminal, followed by a colon. e

25、ach successive indented line contains the right-hand side for a production that has the non-terminal symbol as the left-hand side.declarations in a c# program define the constituent elements of the program. c# programs are organized using namespaces, which can contain type declarations and nested na

26、mespace declarations. type declarations are used to define classes, structs, interfaces, enums, and delegates. the kinds of members permitted in a type declaration depends on the form of the type declaration. for instance, class declarations can contain declarations for instance constructors, destru

27、ctors, static constructors, constants, fields, methods, properties, events, indexers, operators, and nested types.a declaration defines a name in the declaration space to which the declaration belongs. except for overloaded constructor, method, indexer, and operator names, it is an error to have two

28、 or more declarations that introduce members with the same name in a declaration space. it is never possible for a declaration space to contain different kinds of members with the same name. for example, a declaration space can never contain a field and a method by the same name.there are several di

29、fferent types of declaration spaces, as described in the following.within all source files of a program, namespace-member-declarations with no enclosing namespace-declaration are members of a single combined declaration space called the global declaration space.within all source files of a program,

30、namespace-member-declarations within namespace-declarations that have the same fully qualified namespace name are members of a single combined declaration space.each class, struct, or interface declaration creates a new declaration space. names are introduced into this declaration space through clas

31、s-member-declarations, struct-member-declarations, or interface-member-declarations. except for overloaded constructor declarations and static constructor declarations, a class or struct member declaration cannot introduce a member by the same name as the class or struct. a class, struct, or interfa

32、ce permits the declaration of overloaded methods and indexers. a class or struct furthermore permits the declaration of overloaded constructors and operators. for instance, a class, struct, or interface may contain multiple method declarations with the same name, provided these method declarations d

33、iffer in their signature. note that base classes do not contribute to the declaration space of a class, and base interfaces do not contribute to the declaration space of an interface. thus, a derived class or interface is allowed to declare a member with the same name as an inherited member. such a

34、member is said to hide the inherited member.each enumeration declaration creates a new declaration space. names are introduced into this declaration space through enum-member-declarations.each block or switch-block creates a separate declaration space for local variables. names are introduced into t

35、his declaration space through local-variable-declarations. if a block is the body of a constructor or method declaration, the parameters declared in the formal-parameter-list are members of the blocks local variable declaration space. the local variable declaration space of a block includes any nest

36、ed blocks. thus, within a nested block it is not possible to declare a local variable with the same name as a local variable in an enclosing block.each block or switch-block creates a separate declaration space for labels. names are introduced into this declaration space through labeled-statements,

37、and the names are referenced through goto-statements. the label declaration space of a block includes any nested blocks. thus, within a nested block it is not possible to declare a label with the same name as a label in an enclosing block.the textual order in which names are declared is generally of

38、 no significance. in particular, textual order is not significant for the declaration and use of namespaces, types, constants, methods, properties, events, indexers, operators, constructors, destructors, and static constructors. declaration order is significant in the following ways:declaration orde

39、r for field declarations and local variable declarations determines the order in which their initializers (if any) are executed.local variables must be defined before they are used.declaration order for enum member declarations is significant when constant-expression values are omitted.the types of

40、the c# language are divided into three categories: value types, reference types, and pointer types.type:Ø value-typeØ reference-typeØ pointer-typepointer types can be used only in unsafe code.value types differ from reference types in that variables of the value types directly contain

41、 their data, whereas variables of the reference types store references to their data, the latter known as objects. with reference types, it is possible for two variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variab

42、le. with value types, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other.c#s type system is unified such that a value of any type can be treated as an object. every type in c# directly or indirectly derives from the object class type,

43、 and object is the ultimate base class of all types. values of reference types are treated as objects simply by viewing the values as type object. values of value types are treated as objects by performing boxing and unboxing operations .variables represent storage locations. every variable has a ty

44、pe that determines what values can be stored in the variable. c# is a type-safe language, and the c# compiler guarantees that values stored in variables are always of the appropriate type. the value of a variable can be changed through assignment or through use of the + and - operators.a variable must b

温馨提示

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

评论

0/150

提交评论