Presentation is loading. Please wait.

Presentation is loading. Please wait.

.Net Training Lecture – 1 Author: Suhrid Patel. What is.NET ? It is a platform neutral framework. Is a layer between the operating system and the programming.

Similar presentations


Presentation on theme: ".Net Training Lecture – 1 Author: Suhrid Patel. What is.NET ? It is a platform neutral framework. Is a layer between the operating system and the programming."— Presentation transcript:

1 .Net Training Lecture – 1 Author: Suhrid Patel

2 What is.NET ? It is a platform neutral framework. Is a layer between the operating system and the programming language. It supports many programming languages, including VB.NET, C# etc..NET provides a common set of class libraries, which can be accessed from any.NET based programming language. There will not be separate set of classes and libraries for each language. If you know any one.NET language, you can write code in any.NET language!! In future versions of Windows,.NET will be freely distributed as part of operating system and users will never have to install.NET separately.

3 What is Not ?.NET is not an operating system..NET is not a programming language.

4 Currently.NET supports the following languages: C# VB.NET C++ J#

5 What is the CLR? CLR = Common Language Runtime. The CLR is a set of standard resources that (in theory) any.NET program can take advantage of, regardless of programming language. Robert Schmidt (Microsoft) lists the following CLR resources in his MSDN PDC# article:Object- oriented programming model (inheritance, polymorphism, exception handling, garbage collection) Security model Type system All.NET base classes Many.NET framework classes Development, debugging, and profiling tools Execution and code management IL-to-native translators and optimizers What this means is that in the.NET world, different programming languages will be more equal in capability than they have ever been before, although clearly not all languages will support all CLR services

6 What is CLS (Common Language Specificaiton)? It provides the set of specifications which has to be adhered by any new language writer / Compiler writer for.NET Framework. This ensures Interoperability. For example: Within an ASP.NET application written in C#.NET language, we can refer to any DLL written in any other language supported by.NET Framework. As of now.NET Supports around 32 languages.

7 What is CTS (Common Type System)? It defines about how Objects should be declared, defined and used within.NET. CLS is the subset of CTS. This is the range of types that the.NET runtime understands, and therefore that.NET applications can use. However note that not all.NET languages will support all the types in the CTS. The CTS is a superset of the CLS.

8 What is IL? IL = Intermediate Language. Also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All.NET source code (of any language) is compiled to IL. The IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In- Time (JIT) compiler

9 What are the different types of assemblies available and their purpose? Private, Public/shared and Satellite Assemblies. Private Assemblies : Assembly used within an application is known as private assemblies. Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache). Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages

10 Explain the differences between Server- side and Client-side code? Server side scripting means that all the script will be executed by the server and interpreted as needed. ASP doesn't have some of the functionality like sockets, uploading, etc. For these you have to make a custom components usually in VB or VC++. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Download time, browser compatibility, and visible code - since JavaScript and VBScript code is included in the HTML page, then anyone can see the code by viewing the page source. Also a possible security hazards for the client computer

11 Difference between asp and asp.net? ASP (Active Server Pages) and ASP.NET are both server side technologies for building web sites and web applications. ASP.NET is Managed compiled code - asp is interpreted. ASP.net is fully Object oriented. ASP.NET has been entirely re-architected to provide a highly productive programming experience based on the.NET Framework, and a robust infrastructure for building reliable and scalable web applications.

12 Visual Studio for.Net Many people always get confused with Visual Studio.NET (VS.NET) and.NET technology. VS.NET is just an editor, provided by Microsoft to help developers write.NET programs easily. VS.NET editor automatically generates lot of code, allows developers to drag and drop controls to a form, provide short cuts to compile and build the application etc. VS.NET is not a required thing to do.NET programming. You can simply use a notepad or any other simple editor to write your.NET code!!! And you can compile your.NET programs from the command prompt.

13 "Java is platform independent, what about.NET ?". The answer is "Yes" and "No" ! The code you write is platform independent, because whatever you write is getting compiled into MSIL. There is no native code, which depends on your operating system or CPU. But when you execute the MSIL, the.NET framework in the target system will convert the MSIL into native platform code.

14 Creating a Project

15 ToolBox

16 Solution Explorer

17 Output window

18 ASP.Net Modes

19 C# Language Syntax Variable Declaration int a; int salary, incomeTax, sum; int count = 10; string name; string fullName= "Little John"; While Loop int i = 0; while ( i < 5 ) { Console.WriteLine ( i ); ++i; }

20 For Loop int i = 0; for ( int i = 0; i < 5; i++ ) { Console.WriteLine ( i ); } For Each Loop string [] names = new string[]{ "Little John", "Pete", "Jim", "Bill" }; foreach ( string name in names ) { Console.WriteLine ( name ); }

21 If Else Condition string name = "Little John"; if ( name == "Jim" ) { Console.WriteLine( "you are in 'if' block" ); } else { Console.WriteLine( "you are in 'else' block" ); } Break Condition string [ ] names = new string[] { "Little John", "Pete", "Jim", "Bill" }; foreach ( string name in names ) { Console.WriteLine ( name ); if ( name == "Pete" ) break; }

22 Continue string [ ] names = new string[ ]{ "Little John", "Pete", "Jim", "Bill" }; foreach ( string name in names ) { if ( name == "Pete" ) continue; Console.WriteLine ( name ); }

23 Switch Case int i = 3; switch ( i ) { case 5: Console.WriteLine( "Value of i is : " + 5 ); break; case 6: Console.WriteLine( "Value of i is : " + 6 ); break; case 3: Console.WriteLine( "Value of i is : " + 3 ); break; case 4: Console.WriteLine( "Value of i is : " + 4 ); break; default: Console.WriteLine( "Value of i is : " + i ); break; }

24 C# Data Types C# Data typeMapped to.NET class/struct SbyteSystem.SByte ByteSystem.Byte CharSystem.Char FloatSystem.Single DecimalSystem.Decimal DoubleSystem.Double UshortSystem.UInt16 ShortSystem.Int16 UintSystem.UInt32 IntSystem.Int32 UlongSystem.UInt64 LongSystem.Int64 BoolSystem.Boolean StringSystem.String ObjectSystem.Object

25 Example of Class using System; public class Calculator { public int Add(int value1, int value2) { return value1 + value2; } public int Subtract(int value1, int value2) { return value1 - value2; } public int Multiply(int value1, int value2) { return value1 * value2; } public int Divide(int value1, int value2) { return value1 / value2; } }


Download ppt ".Net Training Lecture – 1 Author: Suhrid Patel. What is.NET ? It is a platform neutral framework. Is a layer between the operating system and the programming."

Similar presentations


Ads by Google