SlideShare a Scribd company logo
1 of 25
Introduction to C#
http://www.allsoftsolutions.in
Goals of the course
 Introduce C# language
 ECMA standard
 originally developed by MSR
 not just Java + C++
 many extensions
 Introduce .NET framework
 future of Windows
 base of Microsoft’s C# implementation
http://www.allsoftsolutions.in
Non-goals
 Teach you to program
 should be very comfortable writing OO code
 we will not cover much if any basic programming
 Introduce object oriented languages
 not even teach you OO style (except wrt C#)
 expected to write all code in OO style
 Give you a detailed grade
 S/U only
 even homework
http://www.allsoftsolutions.in
S/U Details
 Requirements for the course
 come to lecture
 participate
 do three assignments
 Assignments are S/U
 will not be giving a detailed grade
 show me that you understand the concepts, and can write
C# code
 All three assignments will be online soon
 must be completed by the end of the course
http://www.allsoftsolutions.in
Administrative Details
 Class time MWF 12:20-1:10
 office hours: W 10:30-12 or by appointment
 tmroeder@cs.cornell.edu (4112 Upson)
 Prerequisites: CS 211/212
 really: experience in OO coding/concepts
 Academic Integrity
 Do not submit work that is not your own
 minimum penalty: U in the course
http://www.allsoftsolutions.in
Useful Tools
 Visual C#
 Express: Google “Visual C# Express”
 in Visual Studio: MSDNAA
 must be version 2005: we need C# 2.0
 Mono: http://www.go-mono.com
 Open Source impl for Linux: not quite at 2.0
 Rotor: http://msdn.microsoft.com/net/sscli
 Shared Source impl for Windows (through 2.0)
 Used to work on BSD / OS X, too
http://www.allsoftsolutions.in
Useful Tools
 Portable.NET: http://www.dotgnu.org
 yet another open source impl
 CMS: http://cms.csuglab.cornell.edu
 we will use this for homework
 turn on your email notifications!
 Course Webpage:
http://www.cs.cornell.edu/courses/cs215
 will post lectures online
 as well as any errata for the homework
http://www.allsoftsolutions.in
CSUGLab
 You all will have accounts
 MSDNAA access: let me know if you don’t
currently have it
 http://www.csuglab.cornell.edu/userinfo.html
 Visual Studio .NET 2005 should be installed there
http://www.allsoftsolutions.in
Syllabus
 Syllabus (10 more lectures)
 C# constructs: 5 lectures
 Types, Delegates, Generics, Reflection, Iterators
 .NET Memory Management: 1 lecture
 Topics: 4 lectures
 C# 3.0, Threading, Security, MSIL, MSH
http://www.allsoftsolutions.in
Quiz 1
 Each class will begin with a quiz
 not for credit but for knowledge
 but I will collect them and see what you know
 Today’s quiz will be on prerequisites
 OO programming, mainly to do with Java
 If you don’t know Java, but do have OO
experience, it’s OK
 talk to me after if you have trouble
http://www.allsoftsolutions.in
What is .NET?
 A Framework in which to run code
 A Common Language Runtime (CLR)
 runs all programs
 C# compiles to Microsoft Intermediate Language
 MSIL runs on CLR
 Virtual Machine like Java
 code written in many languages compiles to MSIL
 A Common Language Specification (CLS)
 A Common Type System (CTS)
http://www.allsoftsolutions.in
What is .NET?
Runtime
Operating System
.NET Framework
Common
Type
System
Common
Language
Runtime
Building Blocks (e.g. for Services)
Services: .NET and COM+
SQL Server BizTalk ...
Languages:
C#, Visual Basic, etc
.NET Applications
Enterprise Servers
...Sharepoint ...
Web Services
From MSDNhttp://www.allsoftsolutions.in
What is the CLR?
Class Loader
MSIL to Native
Compilers (JIT)
Code
Manager
Garbage
Collector (GC)
Security Engine Debug Engine
Type Checker Exception Manager
Thread Support COM Marshaler
Base Class Library Support
From MSDNhttp://www.allsoftsolutions.in
What is the CTS?
 A set of common types
 any language that runs in CLR should implement
 no syntax specified
 Languages often define aliases
 For example
 CTS defines System.Int32 – 4 byte integer
 C# defines int as an alias of System.Int32
http://www.allsoftsolutions.in
What is the CTS?
From MSDNhttp://www.allsoftsolutions.in
What is the CLS?
 A specification of language features
 how methods may be called
 when constructors are called
 subset of the types in CTS are allowed
 For example
 Code that takes UInt32 in a public method
 UInt32 is not in the CLS
 Can mark classes as CLS-compliant
 not marked is assumed to mean not compliant
http://www.allsoftsolutions.in
The Class Libraries
 The common classes used in many programs
 like Java Class Library
 eg.
 System.Console.WriteLine
 XML, Networking, Filesystem, Crypto, containers
 Can inherit from many of these classes
 Many languages run on .NET framework
 C#, C++, J#, Visual Basic
 even have Python (see IronPython)
http://www.allsoftsolutions.in
Assemblies
 Code contained in files called “assemblies”
 code and metadata
 .dll as before
 to run: public static void Main(string[] args)
 types
 private: local directory, not accessible by others
 eg. Wolfram .NETLink
 shared: well-known location, can be GAC
 strong names: use crypto for signatures
 then can add some versioning and trust
http://www.allsoftsolutions.in
COM vs .NET
 Historically, COM provided this integration
 support for interfaces and interaction
 given a GUID, lookup the type library
 dynamically instantiate class
 do RPC to make calls in many cases
 Difficult to get right
 software engineering problems
 not type safe at all
http://www.allsoftsolutions.in
ASP.NET and ADO.NET
 Use .NET languages in web pages
 thus can write typesafe code
 server-side or client-side
 Sharepoint interactions
 can log in
 Use the CLR to access databases
 in the manner of ODBC
 provides classes for access
http://www.allsoftsolutions.in
Windows PowerShell
 New shell originally for MS Vista
 available for WinXP/2k3
 native .NET
 instantiates arbitary .NET classes and accesses them
 Also can access COM objects
 Allows better interaction with programs
 Can it surpass bash and others?
http://www.allsoftsolutions.in
First C# Program
using System;
namespace Test {
int a = 137;
class Hello {
public static void Main(string[] args) {
Console.WriteLine(“Hello {0}”, a);
}
}
}
http://www.allsoftsolutions.in
Constructions of Note
 using
 like import in Java: bring in namespaces
 namespace
 disambiguation of names
 like Internet hierarchical names and Java naming
 class
 like in Java
 single inheritance up to object
http://www.allsoftsolutions.in
Constructions of Note
 Console.Write(Line)
 Takes a formatted string: “Composite Format”
 Indexed elements: e.g., {0}
 can be used multiple times
 only evaluated once
 {index [,alignment][:formatting]}
 also can use as in Java
 “Test “ + a
http://www.allsoftsolutions.in
More C# : basic inheritance
class A {
protected int a;
public virtual void print() {
Console.WriteLine(“a = “ + a);
}
}
class B : A {
public override void print() {
Console.WriteLine(“a really = “ + (a + 137));
}
}
http://www.allsoftsolutions.in

More Related Content

What's hot

Computer programming tools and building process
Computer programming tools and building processComputer programming tools and building process
Computer programming tools and building processArghodeepPaul
 
Presentación rs232 java
Presentación rs232 javaPresentación rs232 java
Presentación rs232 javaJohn Rojas
 
Windows batch scripting
Windows batch scriptingWindows batch scripting
Windows batch scriptingArghodeepPaul
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introductionPeter Gfader
 
0. Course Introduction
0. Course Introduction0. Course Introduction
0. Course IntroductionIntro C# Book
 
Error hanadling in c programming presentation
Error hanadling in c programming presentationError hanadling in c programming presentation
Error hanadling in c programming presentationPranaliPatil76
 
Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3sotlsoc
 
C# programming language
C# programming languageC# programming language
C# programming languageswarnapatil
 
Lecture 10 software development
Lecture 10 software developmentLecture 10 software development
Lecture 10 software developmentJehanzaib Yousuf
 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET ProgrammingKarthikeyan Mkr
 
What is cms_in_php
What is cms_in_phpWhat is cms_in_php
What is cms_in_phpSwati Sharma
 
Overview of .Net Framework
Overview of .Net FrameworkOverview of .Net Framework
Overview of .Net FrameworkNeha Singh
 
CV_NgoQuocVuong
CV_NgoQuocVuongCV_NgoQuocVuong
CV_NgoQuocVuongVuong Ngo
 

What's hot (20)

Computer programming tools and building process
Computer programming tools and building processComputer programming tools and building process
Computer programming tools and building process
 
Windows script host
Windows script hostWindows script host
Windows script host
 
.Net Overview
.Net Overview.Net Overview
.Net Overview
 
Presentación rs232 java
Presentación rs232 javaPresentación rs232 java
Presentación rs232 java
 
Windows batch scripting
Windows batch scriptingWindows batch scripting
Windows batch scripting
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introduction
 
Intro.net
Intro.netIntro.net
Intro.net
 
0. Course Introduction
0. Course Introduction0. Course Introduction
0. Course Introduction
 
Programming
ProgrammingProgramming
Programming
 
Error hanadling in c programming presentation
Error hanadling in c programming presentationError hanadling in c programming presentation
Error hanadling in c programming presentation
 
Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3
 
C# programming language
C# programming languageC# programming language
C# programming language
 
Lecture 10 software development
Lecture 10 software developmentLecture 10 software development
Lecture 10 software development
 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET Programming
 
Csharp
CsharpCsharp
Csharp
 
What is cms_in_php
What is cms_in_phpWhat is cms_in_php
What is cms_in_php
 
PHP Training in Chandigarh
PHP Training in ChandigarhPHP Training in Chandigarh
PHP Training in Chandigarh
 
Overview of .Net Framework
Overview of .Net FrameworkOverview of .Net Framework
Overview of .Net Framework
 
CV_NgoQuocVuong
CV_NgoQuocVuongCV_NgoQuocVuong
CV_NgoQuocVuong
 
Introduction of .net framework
Introduction of .net frameworkIntroduction of .net framework
Introduction of .net framework
 

Similar to C#.net

C#_01_CLROverview.ppt
C#_01_CLROverview.pptC#_01_CLROverview.ppt
C#_01_CLROverview.pptMarcEdwards35
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkDr.Neeraj Kumar Pandey
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfAnassElHousni
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programmingStoian Kirov
 
Presentation1
Presentation1Presentation1
Presentation1kpkcsc
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages mohamed drahem
 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUjwala Junghare
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qaabcxyzqaz
 
Introduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsIntroduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsQUONTRASOLUTIONS
 
Introduction to C3.net Architecture unit
Introduction to C3.net Architecture unitIntroduction to C3.net Architecture unit
Introduction to C3.net Architecture unitKotresh Munavallimatt
 
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptLaurence Svekis ✔
 
LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxAOmaAli
 
Dot net interview_questions
Dot net interview_questionsDot net interview_questions
Dot net interview_questions9292929292
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...bhargavi804095
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)DrUjwala1
 

Similar to C#.net (20)

C#_01_CLROverview.ppt
C#_01_CLROverview.pptC#_01_CLROverview.ppt
C#_01_CLROverview.ppt
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programming
 
10 Sep08 2003ver
10 Sep08 2003ver10 Sep08 2003ver
10 Sep08 2003ver
 
Presentation1
Presentation1Presentation1
Presentation1
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages
 
C sharp
C sharpC sharp
C sharp
 
Dot net
Dot netDot net
Dot net
 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdf
 
Part i
Part iPart i
Part i
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
Introduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsIntroduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutions
 
Introduction to C3.net Architecture unit
Introduction to C3.net Architecture unitIntroduction to C3.net Architecture unit
Introduction to C3.net Architecture unit
 
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScript
 
LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
 
Dot net interview_questions
Dot net interview_questionsDot net interview_questions
Dot net interview_questions
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)
 

More from AllsoftSolutions (9)

Python tutorial
Python tutorialPython tutorial
Python tutorial
 
Iot basics
Iot basicsIot basics
Iot basics
 
C++ basics
C++ basicsC++ basics
C++ basics
 
Python1
Python1Python1
Python1
 
R Basics
R BasicsR Basics
R Basics
 
Mysql using php
Mysql using phpMysql using php
Mysql using php
 
Hbase
HbaseHbase
Hbase
 
Map reduce part1
Map reduce part1Map reduce part1
Map reduce part1
 
Bigdata overview
Bigdata overviewBigdata overview
Bigdata overview
 

Recently uploaded

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Recently uploaded (20)

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

C#.net

  • 2. Goals of the course  Introduce C# language  ECMA standard  originally developed by MSR  not just Java + C++  many extensions  Introduce .NET framework  future of Windows  base of Microsoft’s C# implementation http://www.allsoftsolutions.in
  • 3. Non-goals  Teach you to program  should be very comfortable writing OO code  we will not cover much if any basic programming  Introduce object oriented languages  not even teach you OO style (except wrt C#)  expected to write all code in OO style  Give you a detailed grade  S/U only  even homework http://www.allsoftsolutions.in
  • 4. S/U Details  Requirements for the course  come to lecture  participate  do three assignments  Assignments are S/U  will not be giving a detailed grade  show me that you understand the concepts, and can write C# code  All three assignments will be online soon  must be completed by the end of the course http://www.allsoftsolutions.in
  • 5. Administrative Details  Class time MWF 12:20-1:10  office hours: W 10:30-12 or by appointment  tmroeder@cs.cornell.edu (4112 Upson)  Prerequisites: CS 211/212  really: experience in OO coding/concepts  Academic Integrity  Do not submit work that is not your own  minimum penalty: U in the course http://www.allsoftsolutions.in
  • 6. Useful Tools  Visual C#  Express: Google “Visual C# Express”  in Visual Studio: MSDNAA  must be version 2005: we need C# 2.0  Mono: http://www.go-mono.com  Open Source impl for Linux: not quite at 2.0  Rotor: http://msdn.microsoft.com/net/sscli  Shared Source impl for Windows (through 2.0)  Used to work on BSD / OS X, too http://www.allsoftsolutions.in
  • 7. Useful Tools  Portable.NET: http://www.dotgnu.org  yet another open source impl  CMS: http://cms.csuglab.cornell.edu  we will use this for homework  turn on your email notifications!  Course Webpage: http://www.cs.cornell.edu/courses/cs215  will post lectures online  as well as any errata for the homework http://www.allsoftsolutions.in
  • 8. CSUGLab  You all will have accounts  MSDNAA access: let me know if you don’t currently have it  http://www.csuglab.cornell.edu/userinfo.html  Visual Studio .NET 2005 should be installed there http://www.allsoftsolutions.in
  • 9. Syllabus  Syllabus (10 more lectures)  C# constructs: 5 lectures  Types, Delegates, Generics, Reflection, Iterators  .NET Memory Management: 1 lecture  Topics: 4 lectures  C# 3.0, Threading, Security, MSIL, MSH http://www.allsoftsolutions.in
  • 10. Quiz 1  Each class will begin with a quiz  not for credit but for knowledge  but I will collect them and see what you know  Today’s quiz will be on prerequisites  OO programming, mainly to do with Java  If you don’t know Java, but do have OO experience, it’s OK  talk to me after if you have trouble http://www.allsoftsolutions.in
  • 11. What is .NET?  A Framework in which to run code  A Common Language Runtime (CLR)  runs all programs  C# compiles to Microsoft Intermediate Language  MSIL runs on CLR  Virtual Machine like Java  code written in many languages compiles to MSIL  A Common Language Specification (CLS)  A Common Type System (CTS) http://www.allsoftsolutions.in
  • 12. What is .NET? Runtime Operating System .NET Framework Common Type System Common Language Runtime Building Blocks (e.g. for Services) Services: .NET and COM+ SQL Server BizTalk ... Languages: C#, Visual Basic, etc .NET Applications Enterprise Servers ...Sharepoint ... Web Services From MSDNhttp://www.allsoftsolutions.in
  • 13. What is the CLR? Class Loader MSIL to Native Compilers (JIT) Code Manager Garbage Collector (GC) Security Engine Debug Engine Type Checker Exception Manager Thread Support COM Marshaler Base Class Library Support From MSDNhttp://www.allsoftsolutions.in
  • 14. What is the CTS?  A set of common types  any language that runs in CLR should implement  no syntax specified  Languages often define aliases  For example  CTS defines System.Int32 – 4 byte integer  C# defines int as an alias of System.Int32 http://www.allsoftsolutions.in
  • 15. What is the CTS? From MSDNhttp://www.allsoftsolutions.in
  • 16. What is the CLS?  A specification of language features  how methods may be called  when constructors are called  subset of the types in CTS are allowed  For example  Code that takes UInt32 in a public method  UInt32 is not in the CLS  Can mark classes as CLS-compliant  not marked is assumed to mean not compliant http://www.allsoftsolutions.in
  • 17. The Class Libraries  The common classes used in many programs  like Java Class Library  eg.  System.Console.WriteLine  XML, Networking, Filesystem, Crypto, containers  Can inherit from many of these classes  Many languages run on .NET framework  C#, C++, J#, Visual Basic  even have Python (see IronPython) http://www.allsoftsolutions.in
  • 18. Assemblies  Code contained in files called “assemblies”  code and metadata  .dll as before  to run: public static void Main(string[] args)  types  private: local directory, not accessible by others  eg. Wolfram .NETLink  shared: well-known location, can be GAC  strong names: use crypto for signatures  then can add some versioning and trust http://www.allsoftsolutions.in
  • 19. COM vs .NET  Historically, COM provided this integration  support for interfaces and interaction  given a GUID, lookup the type library  dynamically instantiate class  do RPC to make calls in many cases  Difficult to get right  software engineering problems  not type safe at all http://www.allsoftsolutions.in
  • 20. ASP.NET and ADO.NET  Use .NET languages in web pages  thus can write typesafe code  server-side or client-side  Sharepoint interactions  can log in  Use the CLR to access databases  in the manner of ODBC  provides classes for access http://www.allsoftsolutions.in
  • 21. Windows PowerShell  New shell originally for MS Vista  available for WinXP/2k3  native .NET  instantiates arbitary .NET classes and accesses them  Also can access COM objects  Allows better interaction with programs  Can it surpass bash and others? http://www.allsoftsolutions.in
  • 22. First C# Program using System; namespace Test { int a = 137; class Hello { public static void Main(string[] args) { Console.WriteLine(“Hello {0}”, a); } } } http://www.allsoftsolutions.in
  • 23. Constructions of Note  using  like import in Java: bring in namespaces  namespace  disambiguation of names  like Internet hierarchical names and Java naming  class  like in Java  single inheritance up to object http://www.allsoftsolutions.in
  • 24. Constructions of Note  Console.Write(Line)  Takes a formatted string: “Composite Format”  Indexed elements: e.g., {0}  can be used multiple times  only evaluated once  {index [,alignment][:formatting]}  also can use as in Java  “Test “ + a http://www.allsoftsolutions.in
  • 25. More C# : basic inheritance class A { protected int a; public virtual void print() { Console.WriteLine(“a = “ + a); } } class B : A { public override void print() { Console.WriteLine(“a really = “ + (a + 137)); } } http://www.allsoftsolutions.in