毕业设计(论文)图书在线销售系统外文翻译.doc

上传人:仙人指路1688 文档编号:3978206 上传时间:2023-03-30 格式:DOC 页数:6 大小:43KB
返回 下载 相关 举报
毕业设计(论文)图书在线销售系统外文翻译.doc_第1页
第1页 / 共6页
毕业设计(论文)图书在线销售系统外文翻译.doc_第2页
第2页 / 共6页
毕业设计(论文)图书在线销售系统外文翻译.doc_第3页
第3页 / 共6页
毕业设计(论文)图书在线销售系统外文翻译.doc_第4页
第4页 / 共6页
毕业设计(论文)图书在线销售系统外文翻译.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《毕业设计(论文)图书在线销售系统外文翻译.doc》由会员分享,可在线阅读,更多相关《毕业设计(论文)图书在线销售系统外文翻译.doc(6页珍藏版)》请在三一办公上搜索。

1、本科毕业设计(论文)外文翻译译文:C#基础介绍出自作者Anders Hejlsberg and Scott WiltamuthC#是一种简单,现代,面向对象和类型安全的编程语言,由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.NE

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

3、可以对程度需文本进行条件饱和和删除。2. 语法分析,它把输入字符序列转换为一个标记序列。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#程序,并且可以在运行是作为属性实例来检索。原文:C# basic introductionFrom written by Anders Hejlsberg and Scott WiltamuthC# is a simple, modern, object oriented, and type-safe p

11、rogramming 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+ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C+.Here I will introduce some impor

12、tant 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 scripting languages VBScript and JScript. All of these languages provide access to the Next Generation Windows Services (NWGS) pla

13、tform, 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 lingua franca that ensures seamless interoperability between CLS-compliant languages and class libraries. For C# developers, this means that e

14、ven 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# itself 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 c

15、haracters. Source files typically have a one-to-one correspondence with files in a file system, but this correspondence is not required by C#.Conceptually speaking, a program is compiled using four steps:Pre-processing, a text-to-text translation that enables conditional inclusion and exclusion of p

16、rogram text.Lexical analysis, which translates a stream of input characters into a stream of tokens. Syntactic analysis, which translates the stream of tokens into executable code.Lexical and syntactic grammars for C# are interspersed throughout this specification. The lexical grammar defines how ch

17、aracters can be combined to form tokens; the syntactic grammar defines how tokens can be combined to form C# programs.Grammar productions include non-terminal symbols and terminal symbols. In grammar productions, non-terminal symbols are shown in italic type, and terminal symbols are shown in a fixe

18、d-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. Each successive indented line contains the right-hand side for a production that has the non-terminal symbol as the left-hand side.Declarat

19、ions in a C# program define the constituent elements of the program. C# programs are organized using namespaces, which can contain type declarations and nested namespace declarations. Type declarations are used to define classes, structs, interfaces, enums, and delegates. The kinds of members permit

20、ted in a type declaration depends on the form of the type declaration. For instance, class declarations can contain declarations for instance constructors, destructors, static constructors, constants, fields, methods, properties, events, indexers, operators, and nested types.A declaration defines a

21、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 or more declarations that introduce members with the same name in a declaration space. It is never possible for a declaration space to co

22、ntain 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 different types of declaration spaces, as described in the following.Within all source files of a program, namespace-member-declarations wit

23、h no enclosing namespace-declaration are members of a single combined declaration space called the global declaration space.Within all source files of a program, namespace-member-declarations within namespace-declarations that have the same fully qualified namespace name are members of a single comb

24、ined declaration space.Each class, struct, or interface declaration creates a new declaration space. Names are introduced into this declaration space through class-member-declarations, struct-member-declarations, or interface-member-declarations. Except for overloaded constructor declarations and st

25、atic 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 interface permits the declaration of overloaded methods and indexers. A class or struct furthermore permits the declaration of overloaded constru

26、ctors and operators. For instance, a class, struct, or interface may contain multiple method declarations with the same name, provided these method declarations differ in their signature. Note that base classes do not contribute to the declaration space of a class, and base interfaces do not contrib

27、ute 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 member is said to hide the inherited member.Each enumeration declaration creates a new declaration space. Names are introduced into this d

28、eclaration space through enum-member-declarations.Each block or switch-block creates a separate declaration space for local variables. Names are introduced into this declaration space through local-variable-declarations. If a block is the body of a constructor or method declaration, the parameters d

29、eclared in the formal-parameter-list are members of the blocks local variable declaration space. The local variable declaration space of a block includes any nested 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 enclosi

30、ng block.Each block or switch-block creates a separate declaration space for labels. Names are introduced into this declaration space through labeled-statements, and the names are referenced through goto-statements. The label declaration space of a block includes any nested blocks. Thus, within a ne

31、sted 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 no significance. In particular, textual order is not significant for the declaration and use of namespaces, types, constants, methods, pr

32、operties, events, indexers, operators, constructors, destructors, and static constructors. Declaration order is significant in the following ways:Declaration order for field declarations and local variable declarations determines the order in which their initializers (if any) are executed.Local vari

33、ables must be defined before they are used.Declaration order for enum member declarations is significant when constant-expression values are omitted.The types of the C# language are divided into three categories: Value types, reference types, and pointer types.type: value-type reference-type pointer

34、-typePointer types can be used only in unsafe code.Value types differ from reference types in that variables of the value types directly contain 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

35、two variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variable. 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 i

36、s 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, 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

37、 value types are treated as objects by performing boxing and unboxing operations .Variables represent storage locations. Every variable has a type 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

38、 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 be definitely assigned before its value can be obtained.As described in the following sections, variables are either initially assigned or initially unas

39、signed. An initially assigned variable has a well defined initial value and is always considered definitely assigned. An initially unassigned variable has no initial value. For an initially unassigned variable to be considered definitely assigned at a certain location, an assignment to the variable

40、must occur in every possible execution path leading to that location.Much of the C# language enables the programmer to specify declarative information about the entities defined in the program. For example, the accessibility of a method in a class is specified by decorating it with the method-modifi

41、ers public, protected, internal, and private.C# enables programmers to invent new kinds of declarative information, to specify declarative information for various program entities, and to retrieve attribute information in a run-time environment. For instance, a framework might define a HelpAttribute

42、 attribute that can be placed on program elements such as classes and methods to provide a mapping from program elements to documentation for them.New kinds of declarative information are defined through the declaration of attribute classes, which may have positional and named parameters. Declarative information is specified a C# program using attributes, and can be retrieved at run-time as attribute instances.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号