SUBJECT: C# & .NET FRAMEWORK RGM-R15 Regulations III B
Total Page:16
File Type:pdf, Size:1020Kb
RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK SUBJECT: C# & .NET FRAMEWORK RGM-R15 Regulations III B Tech IISEM DEPARTMENT OF CSE RGMCET,NANDYAL PREPARED BY Mr . G . RAJASEKHAR REDDY 1 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK (A0510155) C# & .NET FRAMEWORK (common to CSE & IT) AIM: To cover the fundamental concepts of the C# language and the .NET framework. OBJECTIVE: The student will gain knowledge in the concepts of the .NET framework as a whole and the technologies that constitute the Framework. The student will gain programming skills in C# both in basic and advanced levels. By building sample applications, the student will get experience and be ready for large-scale projects. OUTCOMES: To get knowledge of windows programming. To get knowledge on server side programming. To gain knowledge on web services and dynamic link libraries. UNIT I INTRODUCTION to C#: Introducing C#, Understanding .NET, Overview of C#, Literals, Variables, Data Types, Operators, Expressions, Branching, Looping, Methods, Arrays, Strings, Structures, Enumerations. UNIT II OBJECT ORIENTED ASPECTS OF C#: Classes, Objects, Inheritance, Polymorphism, Interfaces, Operator Overloading, Delegates, Errors and Exceptions. UNIT III WINDOWS APPLICATIONS: Drawbacks of Console Applications, Container Controls, Non Container Controls, Developing Windows Application from Notepad and Visual Studio, Events, Types of Events – Mouse, Focus, Drag, Key and Other Related Events, Building Windows Applications. ADO.NET: Problems with File Handling, Data Source Communication, Drivers and Providers, Introduction of ADO.NET, ADO.NET Namespaces, ADO.NET Objects, Accessing Data with ADO.NET. UNIT IV BUILDING ASP.NET WEB PAGES: HTML form Development, Client side Scripting, Server side Scripting, Web applications and Web servers, HTTP, Advantages Using ASP.NET, ASP.NET Application, ASP.NET Namespaces, ASP.NET Web Page Structure, Creating Sample C# Web Applications, ASP.NET Web Page Execution Architecture, Debugging and Tracing of ASP.NET. UNIT V 2 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK ASP.NET WEB CONTROLS: Web Form Structures, Introduction to Web Form controls, Server Side Controls, Web Server Controls, GET and POST, Page Submission, Web Page Creation Techniques, Redirection between Web Pages, Validation Controls. UNIT VI WEB SERVICES: Web Services, Web Service Architecture, WSDL, Building WSDL Web Service. CONFIGURING .NET ASSEMBLIES: Private Assemblies, Shared Assemblies, and Versioning. MULTITHREADED PROGRAMMING: Thread Class, Life Cycle of a Thread, Steps for Creating a Thread, Thread Synchronization. 3 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK UNIT I .NET: .NET stands for Network Enable Technology which is developed by Microsoft Corporation. .NET is a collection of languages like VC#.NET, VC++.NET, VB.NET and so on. .NET is a Framework which provides a common platform to Execute or Run the applications developed in various programming languages. .NET Objectives: The .NET Framework is designed to fulfil the following objectives Platform independent: As .exe and .dll files work in any operating system with the help of CLR, hence .Net is called as platform independent. (.exe) is executable file, it consists of executable code, and (.dll) is dynamic link library file it consist of reusable code. .exe and .dll files contains the code in the format of byte code is also called as MSIL (Microsoft intermediate language) code. Machine language is also called as native code. CLR is common language runtime; CLR software converts byte code into native code. Dot Net is platform independent but CLR software is platform dependent. One question arises if we go in detail, that is either Dot Net is pure platform independent or not? Answer is Dot Net is partially platform dependent, as of now CLR software's are not available for DOS operating system and Windows 95. Language independent: As Dot Net programming logic can be developed in any Dot Net framework compatible languages; hence Dot Net is called as language independent. 4 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK Microsoft is introducing approximately 40 languages into Dot Net framework, out of which as of now approximately 24 languages and one specification are released. Ex: VC#.Net,VB.Net,VC++,VJ#,VF#,PHP,COBOL,PERL,PHYTHON,SMALLTALK,JSCRI PT...etc One specification is ASP.Net. Language interoperability: It is a concept of developing an application with the help of more than one .NET programming language. After an application is compiled, the source code will be converted into byte code. Byte code follows a standard instruction set provided by cls(common language specification).Cls provides common rules and syntaxes for all the languages and cls also provides common data types for all the languages and these common data types are called as CTS(common type system). C++ C# VB .NET int(2) short(2) short(2) long(4) int(4) integer(2) long(8) long(8) SYSTEM.INT16 SYSTEM.INT32 SYSTEM.INT64 It supports object-oriented programming environment. It supports to work with database programming with the help of ADO.NET. It supports to work with WPF (windows presentation foundation) for developing animations. It Provides environment for developing various types of applications, such as Windows- based applications and Web-based applications It Supports to develop 3-tier architecture with the help of Dot Net remoting Supports to develop game programming with the help of multi-threading Supports to work with link programming Managed Code: The code is developed and running under the control of the CLR is often termed managed code Unmanaged code: The code which takes OS help while execution is called as unmanaged code Note: Managed code is faster in execution. Unmanaged code CLR .net .dll Output .exe Managed code .NET Framework: The .Net framework is a revolutionary platform that helps you to write the following types of applications: Windows applications 5 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK Web applications Web services The .NET framework applications are multi-platform applications. The .NET framework has been designed in such a way that it can be used by .NET framework compatible languages ( C#, C++, Visual Basic, Jscript, COBOL, etc). All .NET framework compatible languages can access the framework as well as communicate with each other. The .NET frame work contain three major things that is Languages—VB,C#,PASCAL,COBOL Technology—ASP.NET,ADO.NET Servers—SQL SERVER,SHARE POINT SERVER In platform independent languages, the code gets executed under the control of special software called framework. Example: java-->JVM .NET-->CLR Framework: A framework is a software which masks the functionalities of a OS and makes the code to execute under its control .Frame work provides the following basic features like Platform independency Security Memory management Microsoft has started the development of .NET framework in late 90‘s originally under the name of NGWS (next generation windows services). To develop the framework first the Microsoft has prepared a set of specifications known as CLI (common language infrastructure). The .NET specifications are open to all (everyone can develop) which is standardized under ISO (International Standards organization) AND ECMA(European computer manufacture association). CLI specification talks about four important aspects that is CLS (common language specification) CTS (common Type system) BCL (Base class libraries) VES (Virtual execution system) or CLR (common language runtime) .NET framework versions Versions Release Date 6 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK 1.0 2002 1.1 2003 2.0 2005 3.0 2006 3.5 2007 4.0 2009 The .Net framework consists of an enormous library of codes used by the client languages such as C#. Following are some of the components of the .Net framework: Common Language Runtime (CLR) The .Net Framework Class Library Common Language Specification Common Type System Metadata and Assemblies Windows Forms ASP.Net and ASP.Net AJAX ADO.Net Windows Workflow Foundation (WF) Windows Presentation Foundation Windows Communication Foundation (WCF) LINQ .NET framework architectural diagram: The .NET framework is one of the tool provided by the .NET infrastructure and tools component of the .NET platform. The .NET framework provides an environment for building, deploying and running web services and .NET applications. PLINQ TPL LINQ ADO.NET ENTITY FRAMEWORK WPF WCF WF CARD SPACE ADO.NET ASP.NET WIN FORMS BASE CLASS LIBRARIES COMMON LANGUAGE RUNTIME(CLR) Common language runtime (CLR): CLR is the heart of the .NET framework. It is the execution engine of .NET framework, where all .net applications are running under the supervision of CLR. The main function of CLR is to convert the managed code into native code and then execute the program. CLR acts 7 School of Computer Science & Engineering | RGMCET RGM COLLEGE OF ENGG&TECH C# & .NET FRAMEWORK as a layer between OS and the applications written in .NET languages. CLR provides various features to applications like Security Platform independency Automatic memory management Runtime error handling Code verification Compilation Thread management The components of CLR are Class Loader: