Overview CNS 3260 C#.NET Software Development. 2.NET Framework Began in 2000 Developed in three years (2000 to 2003) Operating System Hardware.NET Framework.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Advertisements

C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
C#: Data Types Based on slides by Joe Hummel. 2 UCN Technology: Computer Science Content: “.NET is designed around the CTS, or Common Type System.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
Introduction to the C# Programming Language for the VB Programmer.
History  We first begin with Java which was released in 1995 by Sun Microsystems  Initially Java was 100% interpreted at runtime and was very slow 
C#/.NET Jacob Lewallen. C# vs.NET.NET is a platform. Many languages compile to.NET: –VB.NET –Python.NET –Managed C++ –C#
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Programming in C# Language Overview
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Introduction to .NET Framework
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Compiling and Executing Code in.Net Microsoft Intermediate Language and Common Language Runtime.
All 300/400 Level CS Major Courses Tutoring Location: SEC 3433 Sign up or walk-in Introduction2-1.
Introduction .NET Framework
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Distributed Systems (236351) Tutorial 1 - Getting Started with Visual Studio C#.NET.
.NET Framework Danish Sami UG Lead.NetFoundry
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Introduction to C# C# is - elegant, type-safe, object oriented language enabling to build applications that run on the.NET framework - types of applications.
CS_OOP Lecture #2: Computer Hardware/Software; Variables, C# Data Types, and IO.
Week 1: THE C# LANGUAGE Chapter 1: Variables and Expressions ➤ Included in Visual Studio.NET ➤ What the.NET Framework is and what it contains ➤ How.NET.
C#C# Introduction CS3260 Dennis A. Fairclough Version 1.0 Introduction CS3260 Dennis A. Fairclough Version 1.0.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Application Foundation Presented By : Naveed Sattar Software Engineer.
Languages and IDE (Integrated Development Environment)
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
1 C# A brief overview by Jack Senechal and Bryan Powell.
Microsoft.Net Sven Groot. Common Language Runtime Superset of ECMA Common Language Infrastructure Defines  Language-neutral platform  Intermediate Language.
C# Introduction Part 1. Which Visual Studio Should I use? Any Express (2012, 2013…) or Community Edition 2013 Any full version.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
C# C1 CSC 298 Elements of C# code (part 1). C# C2 Style for identifiers  Identifier: class, method, property (defined shortly) or variable names  class,
C Sharp Web & Internet Programming Group Diana, Aren, Jeff, & Adam, Farrin 5/5/20081CS 311.
Bill Campbell, UMB Microsoft's.NET C# and The Common Language Runtime.
Chapters 2 & 3. .NET Software development model that allows applications created in disparate programming languages to communicate Universal data access.
Object Oriented Software Development 4. C# data types, objects and references.
A comparison of C-Sharp and Java Zunaid Jogee Supervisor: T. Stakemire.
2: Basics Basics Programming C# © 2003 DevelopMentor, Inc. 12/1/2003.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
Introduction to C# Anders Hejlsberg Distinguished Engineer Developer Division Microsoft Corporation.
The Execution System1. 2 Introduction Managed code and managed data qualify code or data that executes in cooperation with the execution engine The execution.
Object Oriented Programming Lecture 2: BallWorld.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
INTRODUCTION BEGINNING C#. C# AND THE.NET RUNTIME AND LIBRARIES The C# compiler compiles and convert C# programs. NET Common Language Runtime (CLR) executes.
Building C# Applications
C++ Lesson 1.
Basic Introduction to C#
Introduction to .NET Framework
Foundations of .Net Programming with C#
Internet and Java Foundations, Programming and Practice
C# and the .NET Framework
Introduction to .NET Framework Ch2 – Deitel’s Book
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Application Foundation
CS360 Windows Programming
Chapter 1 IDE and Tools for Developing CLR-based Programs
Introduction to C# AKEEL AHMED.
Programming in C# CHAPTER 1
.NET Base Type (CTS Data Type) Managed Extensions for C++ Keyword
IS 135 Business Programming
C# and ASP.NET Programming
Presentation transcript:

Overview CNS 3260 C#.NET Software Development

2.NET Framework Began in 2000 Developed in three years (2000 to 2003) Operating System Hardware.NET Framework Runtime (CLR).Net Application.Net DLL.Net Web Service

3 Source Code  Output C# source code CSC MSIL CLR CSC – C# Compiler MSIL – Microsoft Intermidiate Language or IL CLR - Common Language Runtime

4 Common Language Runtime (CLR) Similar to the Java Virtual Machine All.NET languages compile down to Intermediate Language (MSIL or just IL) CLR Runs the IL language IL compiled “Just In Time” (JIT) Compiled code reflects the current platform’s assembly language

5 JIT JIT code compiled at runtime and loaded into RAM Slow? Use ngen.exe If more RAM is needed, least used code is dropped If that code is needed again, it is recompiled and reloaded Buy more RAM Once code is loaded it stays in RAM and is reused as much as needed with no interpretation (conversion) overhead

6 MSIL ka IL Code Example class MainClass { public static void Main() { int i = 7; int j = i + 8; Console.WriteLine(j); } Translates to .method public hidebysig static void Main() cil managed {.entrypoint // Code size 13 (0xd).maxstack 2.locals init (int32 V_0, int32 V_1) IL_0000: ldc.i4.7 IL_0001: stloc.0 IL_0002: ldloc.0 IL_0003: ldc.i4.8 IL_0004: add IL_0005: stloc.1 IL_0006: ldloc.1 IL_0007: call void [mscorlib]System.Console::WriteLine(int32 ) IL_000c: ret } // end of method MainClass::Main A nice tool:

7 CLR Power.NET Languages can inherit, pass variables, throw exceptions seamlessly to each other IL in-process of standardization by ECMA (European Computer Manufacturers Association) Automatic garbage collection Be sure to nullify references. Be sure to Dispose classes requiring disposing (covered later)

8 Common Type System (CTS) All.NET languages use the same types All.NET languages, creating the same type of code, can interact with each other’s types Library types provided by.NET Framework Class Library (FCL) Standardized Available in all languages All objects inherit from Object directly or indirectly

9 Datatype Value Types Enumeration Types Struct Types Standard/Simple Types Reference Types Pointer Types (discouraged even in C++) unmanaged code

10 CTS Simple Types Integral Types: byte8 bitsunsigned sbyte8 bitssigned char16 bitsunsigned unicode short16 bitssigned ushort16 bitsunsigned int32 bitssigned uint32 bitsunsigned long64 bitssigned ulong64 bitsunsigned Floating Point Type single 7 digitssigned double15-16 digitssigned Decimal Type Decimal28-29 significant digits signed Boolean Type bool8 bits(true or false)

11 CTS Reference Types Built-in object string (immutable) User-Defined classes Delegates

12 Visual Studio.NET 2003 Editor Powerful (and getting more powerful with 2005) Easy to use Syntax error detection Errors underlined in blue or red Hot keys for just about anything Customizable MSDN help built in (F1)

13 Default Shortcut Keys For a full list, search for “Shortcut” with the filter set to “Visual Studio Macros” Follow the link: “Default Settings Shortcut Keys”

14 Custom Shortcut Keys Go to Tools | Options | Environment | Keyboard Scroll through the actions listed, select the action you want Click in the “Press Shortcut Key(s)” box and press the keys you want to use It tells you, if that shortcut combination is being used and what it is being used by.

15 Collapsible Code regions use #region to start a region use #endregion to end a region use CTRL + M, CTRL + M to collapse the immediate region use CTRL + M, CTRL + L to toggle collapsing and expanding the entire file

16 XML Comments use “///” to add an XML Comment to your code XML Comments show up in the intellisense.

17 MSDN Documentation Search the index Use the filter Use the F1 key in your code Available online

18 Getting into the code using System; namespace HelloWorldProgram { class MyClass { static void Main() { Console.WriteLine(“Hello World”); } } }

19 C# Namespaces System System.Collections System.Data System.Diagnostics System.Globalization System.IO System.Net System.Reflection System.Resources System.Runtime System.Security System.Text System.Threading System.Timers System.Web System.Windows System.Windows.Forms System.Xml...and many more

20 Main( ) Main( ) must be static Main( ) can be public or private Doesn’t matter Only one Main( ) per class Can have multiple Main( )’s per program There is a command line switch to tell the compiler which Main() to use at startup

21 Main( ) Signatures Main() can have one of two different signatures Main( ) Main(string[] commandLineArguments) Main can have one of two different return types int or void static void Main(string[] args){ } static int Main(string[] args){ } static void Main(){ } static int Main(){ }

22 Anatomy of a Method Method ::= ([parameter list]) { } Parameter list ::= [ {, datatype identifier}] Example public void MyMethod(int myParam0, float myParam1) { //method body }

23 Simple Program using System; public class MainClass : object { [STAThread] static void Main() { Console.WriteLine(“Hello world.”); } (See Hello World Demo)

24 Compiling Command line: csc [filename] [options] VS: CTRL + SHIFT + B F5 (compiles and runs)

25 Preprocessor Search for “Preprocessor” with “Visual C#” filter