1、附录1英文文献翻译1.英文1.1INTROUCTION TO C#1.1.1The Birth of C#As a recent birth in the programming language family# has two programming language parents+ and Java# contains many C+ features but also adds the object-oriented features from Java.C# contains many different components, including:Versioning suppor
2、t, so that your base and derived classes-templates that define how an object performs一remain compatible as you develop themEvents, so that your program can notify clients of a class about something that has happened to an objectType safety and verification that increases reliability and ensures code
3、 securityGarbage collection, so that your program can identity objects that your program can no longer reachUnsafe mode, where you can use pointers to manipulate memory outside the garbage collectors control, including methods and properties1.1.2Close Relations with C and C+C# is built on the C+ lan
4、guage, so it behaves much like the language. Like C+, C# lets you write enterprise applications, and C# contains many C+ features, including statements and operators. C# also provides access to common Application Program Interface (API) styles including Component Object Model (COM) and C-style APIs.
5、1.1.3SecurityComputer networks let programmers share Visual Studio.NET code including C# programs across the network .This collaborative effort lets you and your programming team create C# programs much more quickly than one person alone. The problem with collaborating over a network is that unautho
6、rized users from within or outside your network may try to gain access to your C# program code.Visual Studio.NET provides built-in security features so you or the leader of your programming team can determine who on your network gets access to your C# program code and resources. You can also set dif
7、ferent levels of security for different people in case you want only certain people to have access to certain program code.1.1.4IntegrationThe primary advantage of using Visual Studio.NET is that all of the programming languages have been designed to work together from the start. When you write a ne
8、w C# program, Visual Studio.NET gives you tools that you can use to program links from your C# program into another program written in another Visual Studio.NET language.For example, you can create a database in Visual FoxPro and then create a C# program that links into the Visual FoxPro database. I
9、f you have written or acquired completed programs in a Visual Studio language such as Visual C+ or Visual Basic, you can include links from your C# program into those programs. The end result is seamless integrated functionality between programs.1.1.5Differences Between C# and C+Microsoft includes V
10、isual C+ and C# in Visual Studio .NET. On the surface# has few differences from Visual C+. When you look carefully and start programming, you will notice that C# differs in several important respects from Visual C+:C# has an alternate method of accessing the C+ initialization list when constructing
11、the base class.A class can inherit implementation from only one base class.You can call overridden base class members from derived classes.C# has a different syntax for declaring C# arrays.There are differences in several different types including bool, struct, and delegate.The Main method is declar
12、ed differently.Support of the new ref and out method parameters that are used instead of pointers for passing parameters by reference.New statements including switch and finally.New operators including is and typeof.Different functionality for some operators and for overloading operators.1.1.6DLLsTh
13、e advent of Windows brought dynamic link libraries (DLLs) to programmers. DLLs are small, independent programs that contain executable routines that programs can use to produce a certain result in Windows. For example, if a program needs to open a file, you can write your C# program that uses the co
14、de in the DLL to open the file. Using DLLs frees up your time to work on your program without having to reprogram the same code in your C# program over and over again.You can access DLLs from your C# program, and create DLLs in C# for your C# for your C# program to refer to when necessary. C# has fu
15、ll COM/Platform support, so you can integrate C# code with any programming language that can produce COM DLLs such as Visual C+.1.1.7XMLExtensible Markup Language (XML) is a more powerful version of Hyper Text Markup Language (HTML), the standard Web page language. Visual Studio.NET and C# let you d
16、ocument your program using XML and then extract the XML code into a separate file.Visual Studio.NET supports XML so that you can integrate your C# programs with the World Wide Web. You can document your C# code using XML and then use XML for creating Web Services and Web controls that let you and yo
17、ur code interact with a Web site. For example, you may have an inventory system written in C# that interacts with the order-taking page on your companys Web Site.1.2START VISUAL STUDIO.NETVisual Studio.NET contains a graphical programming environment called the Microsoft Development Environment (MDE
18、). The MDE enables you to create programs in Visual C# and other Visual Studio.NET languages.When you start Visual Studo.Net, the MDE window appears with several windows within the MDE windows. In the largest area of the MDE window, which is called the parent window, the Visual Studio Start page app
19、ears. The Start page lists any recent projects and provides two buttons so that you can open a project file or create a new project.The Start page lets you log into the Microsoft Developers Network (MSDN) Web site directly from the MDE, so you can receive the latest information from Microsoft about
20、Visual Studio, get technical help from fellow Visual Studio users at Microsofts online forum, and search for information online.Visual Studio.NET also lets you create and change your profile so that can view windows, enter keyboard commands, and receive help for the programming language in which you
21、 are working .For example , if you have used an older version of Visual Studio in the past and you prefer to use the old windows and keyboard commands, Visual Studio lets you use Visual Basic and C+ windows and menus.1.3OPEN A NEW C# PROJECTAfter you start the MDE windows , you can open a new projec
22、t .A project contains all the files related to your C# program. After you determine the type of C# program you want to write, Visual Studio creates all of the project files you need to start programming. Visual Studio contains programs. The MDE window lets you create eight different projects so you
23、can tailor your C# program to the needs of your program users.You can create three different application types, each with a different user interface. First, you can create a Windows application that has a graphical, form-based interface. You can create a console application with a character-based in
24、terface. Finally, you can create a Web application that resides on a Web server and uses Web pages for its interface.You can create three types of programs that are not full-fledged but provide components that other programs can use. First ,you can create a class library program so you can provide c
25、lass for other programs. Second, you can create a Windows control library for creating form controls such as buttons. Third, you can create a Web control library program that provides Web controls for your Web-based C# programs.When the Open Project window appears, it shows all the projects in the d
26、efault project folder, My Projects. By clicking one of the icons on the left side of the Project Location window, you can choose the folder from which a project is opened.In the Project Location windows, you can also select any folder on your hard drive by clicking the Down Arrow next to the Look in
27、 field and then selecting your drive. The folders on the selected drive appear in the window.1.4EXPLORING THE C# INTERFACEWhen you start a new C# project, C# creates default classes that define and categorize the elements in your new program. For example, if you start a new program .For example, if
28、you start a new Windows application that has objects. The Class View window lets you view all your classes and their related components so you knew exactly what is in your class code without having to search through the code.The Class View window gives you a convenient way to see with which class an
29、 object in your program is associated without having to close or minimize your program code or form. The Class View window appears in the same space in the Microsoft Development Environment window as the Solution Explorer window.The class information appears in a tree format that you can expand to v
30、iew all classes associated with a particular program component, such as a form. If you have more than one program in a project, the Class View window tree lets you access classes for all the programs in the project.If you want to see classes that meet certain criteria, you can sort classes in the tr
31、ee alphabetically, by type for viewing related classes in your program, or by access.If the Class View window is not available as a tab at the bottom of the Solution Explorer window, you can access the Class View window from the menu bar.You can open the Class View window by clicking View and then C
32、lass View on the menu. You can also open the Class View window by pressing Ctrl+Shift+C. No matter if you access the Class View window using the menu or the keyboard, after you open the Class View window, it replaces the Solution Explorer in the upper-right corner of the parent window.When you click a class, the properties for that class appear in the Properties window; the Properties window appears below the Class View window.If you do not have the Properties window open, you can right-click the class and then click Propert
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2