Introduction to .NET with C# @ university of wayamba


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Introduction to .NET with C# @ university of wayamba

  1. 1. The choice of real engineers…Prepared & Presented by :- Prageeth Sandakalum, Microsoft Student Champ
  2. 2. Microsoft .NET Framework  What is a “framework”  An overview of the .NET Virtual Machine  Inside the .NET framework  .NET framework language support  .NET framework class library  C# Language Vs Java  Completely new features in C#  Before you begin  Writing the first C# code  Visual Studio Fun…
  3. 3. C# .NET Language  Access modifiers, Conditions, Loops  Object Oriented Programming in C#  Classes and Objects  Inheritance  Polymorphism  Encapsulation  Value Types Vs Reference Type  C# special language features  Enumerations, Nullable Types, Partial Classes, Operator Overloading  Windows Forms
  4. 4. .NET ??We have many. Why another 1? .NET Framework (3.5) All in 1 solution for a programmer…
  5. 5. A framework a set of ideas, principles, agreements, or rules thatprovides the basis or outline for something intended to be morefully developed at a later stage - MSN Encarta -A software framework is a re-usable design for a softwaresystem (or subsystem).A software framework may include support programs, codelibraries, a scripting language, or other software to help developand glue together the different components of a softwareproject. - Wikipedia -
  6. 6.  Language neutral. many languages with a common class library Provides a runtime and a set of common libraries for writing and executing written programs in any compliant language. The runtime is called the .NET CLR (Common Language Runtime) – similar to the Java Runtime. CLR Provides the functionality to  Activate objects, perform security Checks, Memory Allocation, Execution, etc…
  7. 7. VB C++ C# J# … Secure, integrated class libraries Common Language Specification  Unifies programming models across languages Visual Studio .NET ASP .NET WindowsWeb Forms Web Services Enables cross-language Forms  Mobile Internet Toolkit integration ADO .NET and XML  Factored for extensibility Base Class Library  Designed for tools  Create frameworks on top Common Language Runtime of the high level .NET framework Operating SystemASP.NET Common Language Runtime High-productivity environment  Executes code, maintains for building and running security, handles component Web services “plumbing” and dependencies
  8. 8.  Common Language Specification. First class support for all CLS compliant languages. Microsoft provided languages. Visual Basic®, C#, C++, J#, JScript®. 3rd-party provided languages  APL, Cobol, Component Pascal, Eiffel, Fortran, Haskell, Mercury, Oberon, Oz, Perl, Python, RPG, Scheme, Smalltalk, Standard ML, Ruby, Delphi and the list is growing!
  9. 9. Spans All Programming Languages. Enables cross-language inheritance and debugging. Integrates well with tools.Is Object-Oriented and Consistent.  Enhances developer productivity by reducing the number of APIs to learn.Has a Built-In Common Type System.Is Extensible. Makes it easy to add or modify framework features.Is Secure. Allows creation of secure applications.
  10. 10. As in Java Object-Orientation with single inheritance Interfaces Exceptions Threads Packaging Garbage Collection Reflection Dynamic loading of code …
  11. 11.  References and output parameters Objects on the stack (structs) Attributes Indexers Partial Types Loosely Typed Variables Enumerations Operator Overloading Nullable types Lambda Expressions …
  12. 12.  Dynamic Link Libraries Adding references Adding Projects Structuring the Code Using the .DLLs Namespaces Adding files to the projects Aliases Adding arguments Console.Read()
  13. 13. Let’s start Codingand take a tour inVisual Studio..!
  14. 14. C#.NET Language FeaturesThe Finest roadmap in application development
  15. 15.  Access Modifiers  Private, Public, protected  Internal, internal protected Variable declaration  Static, Constant, Var IF – ELSE – ELSE IF Switch-Case Arrays Loops  For, While, Do-While, Foreach
  16. 16. Write a small program to take 3 numbers using command linearguments and insert into the array. Then add thesenumbers. If the total is larger than 100 print a message…
  17. 17.  Declaring classes Creating Object Inheritance  Sealed Classes, Interfaces Polymorphism  Overriding, Overloading Encapsulation  Properties Special Keywords  params, ref
  18. 18. Write a program to create an Animal super class and create aCat, Dog classes which extends it… Use properties toinitialize the number of legs each animal has.Write a program to test the ref variable and the paramskeyword
  19. 19. Structs  Value type representation of classes  Ideal for Light weight objects or heavily used objects  Polygon, Rectangle classes  Fraction class in a mathematical projectEnumerationsNullable TypesPartial ClassesOperator Overloading
  20. 20. Create a struct for complex numbers.. Use operatoroverloading to implement the multiplication
  21. 21. Let’s create a simple WindowsBased Client Application inC#.NET using Visual Studio..!
  22. 22. Thank You !!!Contact me for further clarification Prageeth Sandakalum