畢業(yè)設計(論文)圖書在線銷售系統(tǒng)外文翻譯_第1頁
畢業(yè)設計(論文)圖書在線銷售系統(tǒng)外文翻譯_第2頁
畢業(yè)設計(論文)圖書在線銷售系統(tǒng)外文翻譯_第3頁
畢業(yè)設計(論文)圖書在線銷售系統(tǒng)外文翻譯_第4頁
畢業(yè)設計(論文)圖書在線銷售系統(tǒng)外文翻譯_第5頁
免費預覽已結束,剩余1頁可下載查看

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、本科畢業(yè)設計(論文)外文翻譯譯文:c#基礎介紹出自作者anders hejlsberg and scott wiltamuthc#是一種簡單,現(xiàn)代,面向對象和類型安全的編程語言,由c和c+發(fā)展而來。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 平臺的訪問能力,它包括一個通用的執(zhí)行引擎和一個豐富的類庫。microsoft.net平臺定義了一個“通用語言子集”(cls),是一種混合語言,它可以增強cls兼容語言和類庫間的無縫協(xié)同工作能力。對于c#開發(fā)者,這意味著既是c#是一種新的語言,它已經可以對用老牌工具如visual basic和visual c+使用的豐富類庫進行完全訪問。c#子集并沒有包含一個類庫。一個c#程序由一個或多個源文件組成。一個源文件是一個統(tǒng)一字符編碼的字符的有序序列。燕文件通常和文件系統(tǒng)種的文件有一一對應關系,但是這個對應關系并不需要。從概念來講,一個程序在編譯時有四步:1. 預處理,一種文本到文本的轉換,這使得

3、可以對程度需文本進行條件飽和和刪除。2. 語法分析,它把輸入字符序列轉換為一個標記序列。3. 句法分析,它把標記序列轉換為可執(zhí)行代碼。c#的詞匯和句子的文法散步在整個文章中。詞匯文法定義如能把字符組合為形式標記:句子的文法定義了如何把標記組合為c#程序。文法生成包括無詞尾符號和有詞尾符號。在文法生成當中,無詞尾符號用意大利體表示,而有詞尾符號用定寬字體。每一個吳詞尾符號定義為一系列產品(production)。這一系列產品的第一行是吳詞尾符號的名稱,接下來是一個冒號。對于一個場頻,每個連續(xù)的鋸齒狀的行的右手邊同左手邊類似是無詞尾符號。c#程序中的生命定義了程序的重要聲明。c#程序用名稱空間來組

4、織,它可以包含類型聲明和潛逃聲明。類型聲明用來定義類,結構,接口,類的聲明可以包含實例構造函數(shù),析構函數(shù),靜態(tài)構造函數(shù),常數(shù),域,方法,屬性,時間,索引,操作符和潛逃類型。一個聲明在聲明所屬的聲明域定義了一個名稱。除了重載構造函數(shù),方法,索引和操作符名稱,在一個聲明域種有兩個或更多介紹有相同名稱成員的聲明時,是錯誤的。對一個而生命域中,包含有相同名稱的不同種類成員是永遠不可能的。例如,一個聲明域種不能包括有相同名稱的域和方法。這里有許多種不同類型的聲明域,如下表示:在所有程序的源文件種,不包括嵌套名稱空間聲明的名稱空間成員聲明都是一個單獨的組合聲明域,稱為全局聲明域。在所有程序的源文件種,名稱

5、空間成員聲明和有相同完整正確的名稱空間名稱的名稱空間聲明都是一個單獨的組合聲明域。每個類,結構或接口聲明都會創(chuàng)建一個新的聲明域。名稱通過類成員聲明,結構成員什么或接口成員聲明介紹到這個聲明域中。除了重載構造函數(shù)聲明和靜態(tài)構造函數(shù)聲明,一個類類或結構成員聲明不能引入域類或結構名稱相同的成員。一個類,節(jié)后或接口允許方法和所以的重載。此外,一個類聲明的方法,而在他們各自簽名中提供了不同的方法聲明。注意基類不影響類的聲明域。而基本接口不影響一個接口的聲明域。這樣,一個派生的類或接口可以用和繼承的成員相同的名稱聲明一個成員。這樣的一個成員貝成為隱藏了繼承的成員。每個枚舉聲明創(chuàng)建一個新的聲明域。名稱通過枚

6、舉成員聲明介紹到聲明域中。每個塊或者轉換為局部變量創(chuàng)建一個分立聲明域。名稱通過局部變量聲明貝引入到這個聲明域。如果一個塊是構造函數(shù)或方法聲明的主體,在形參列表中聲明的參數(shù)是這2個塊的局部變量聲明域的成員。塊的局部變量聲明域包括任何嵌套塊。因而,在一個嵌套塊中不太可能用域嵌套塊中的局部變量有相同名稱聲明一個局部變量每個塊或轉換塊為標簽創(chuàng)建一個分立的聲明域。名稱通過標簽聲明貝引入到這個聲明域,而名稱通過goto聲明引入到這2個聲明域。塊的局部變量聲明域包括任何嵌套塊。因而,在一個嵌套塊中不太可能用域嵌套塊中的標簽想同名稱聲明一個標簽。在名稱貝聲明的文本順序通常并不重要。特別是,文本順序對于聲明和使

7、用名稱空間,類型,常數(shù),方法,屬性,時間,索引,操作符,構造函數(shù),析構函數(shù)和靜態(tài)構造函數(shù)來說并不重要。聲明順序在下面的途徑才是重要的:域聲明和局部變量的聲明順序決定了他們的初始化是按聲明順序執(zhí)行。局部變量必須在他們被使用前定義。當常數(shù)表達式數(shù)值貝忽略,枚舉成員的聲明順序是重要的。c#語言的類型被分為三類:數(shù)值類型,引用類型和指針類型。 type: value-type reference-type pointer-type指針類型只能用在不安全代碼。數(shù)值類型與引用類型所不同的是,數(shù)值類型變量直接含有他們的數(shù)據(jù),然而引用類型的變量存儲對他們的數(shù)據(jù)的引用,就是后面要接受的對象。獨語引用類型,可能會

8、出現(xiàn)兩個變量引用相同對象的情況,這樣對于一個變量的操作就有可能影響到由其他變量引用的對象。對于數(shù)值類型,每個變量都有他們自己對數(shù)據(jù)的拷貝,這樣就不能能出現(xiàn)一個對變量的操作影響到另外一個的情況。c#的類型系統(tǒng)是統(tǒng)一的,這樣任何類型的數(shù)據(jù)都可以貝看作對象。c#中的任何類型都直接或簡介地從bojiect類類型派生,而object是所有類型的最基本類。引用類型的數(shù)值貝看作通過對象,這些對象通過把數(shù)值看作類型對象來簡化。數(shù)值類型的數(shù)值通過包裝和解包裝操作來貝當作對象。變量代表數(shù)據(jù)的實際存儲位置。每各變量所能存儲的數(shù)值由它本省的類型決定。c+語言是一種類項安全語言(tsl),而且c+編譯器保證每一個數(shù)值貝

9、保存在相應的變量中。變量的數(shù)值可以通過賦值或者+或-運算符改變。在變量貝賦值以前,變量自身的類型必須貝明確的聲明。變量或者貝初始化的或者未初始化的。一個初始化的變量在貝定義時貝賦予了一個確定的初始值,而未初始化的變量在定義時并未貝賦予確定的初始值。對于一個在程序某處貝認為具有確定數(shù)值的iua,必然在指向這一位置的所有可能的執(zhí)行路徑上存在賦值操作。c#語言的大多數(shù)都使得程序員可以制定關于在程序中定義的實體的公開的消息。例如,一個類中的一個方法的可訪問性,可以通過用方法修飾符public,protected,internal和private對它進行修飾來制定。c#使得程序員可以創(chuàng)造聲明信息的新的種

10、類,來為各種程序實體指定聲明信息,并且在運行時環(huán)境中找回屬性信息。例如,一個框架也許定義了一個helpattribute屬性,它可以被放在例如類和方法的程序元素種類來提供從程序元素到他們的文檔的映射。聲明信息的新種類通過屬性類的聲明來定義,它可能有位置的和名稱的參數(shù)。聲明信息使用屬性來指定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 unassigned. an initially assigned variable has

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論