1、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 support, so that your base and derived
2、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 securityGarbage collection, so t
3、hat 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+ language, so it behaves much like th
4、e 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.1.1.3SecurityComputer networks le
5、t 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 unauthorized users from within or outsid
6、e 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 different levels of security for dif
7、ferent 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 new C# program, Visual Studio.NET g
8、ives 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. If you have written or acquired co
9、mpleted 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 Visual C+ and C# in Visual Studio
10、.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 the base class.A class can inheri
11、t 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 declared differently.Support of the new
12、 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.6DLLsThe advent of Windows brought dynam
13、ic 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 code in the DLL to open the file. U
14、sing 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 full COM/Platform support, so you c
15、an 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 document your program using XML an
16、d 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 your code interact with a Web site. For example, you may have an inventory sys
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1