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.

Slides:



Advertisements
Similar presentations
Introduction to the C# Programming Language for the VB Programmer.
Advertisements

1/50 Project Management. 2/50 StumbleUpon 3/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces,
Introduction to Computing and Programming
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program.
Chapter 3: Introducing the Microsoft.NET Framework and Visual Basic.NET Visual Basic.NET Programming: From Problem Analysis to Program Design.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
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.
Creating a Console Application with Visual Studio
Object Oriented Software Development 1. Introduction to C# and Visual Studio.
Chapter 1 Introduction to Programming and C# Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Week 1: Introduce ➤ What is the.NET Framework ?  CLR, MSIL,IL,FLC  Garbage collection  Namespace ➤ What C# is and how it relates to the.NET Framework.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Introduction to.NET Content : – Introduction to.NET Technology – Introduction to Web Based Applications – Introduction to ASP.NET 1 By : Amrendra Sharan.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
A First Program Using C#
Neal Stublen Overview of.NET Windows Applications Microsoft Windows OS / Intel Platform Windows Application File SystemNetworkDisplay.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
Intro to C# Dr. John P. Abraham UTPA. Background required Thorough C++ programming – If you made an A in 1370/1170 you will do fine with some effort.
Module 1: Introduction to C# Module 2: Variables and Data Types
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.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to .NET Framework
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
CSC 494/594 C# and ASP.NET Programming. C# 2012 C# Object-oriented language with syntax that is similar to Java.
Neal Stublen Class Objectives  Develop an understanding of the.NET Framework  Gain proficiency using Visual Studio  Begin learning.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
All 300/400 Level CS Major Courses Tutoring Location: SEC 3433 Sign up or walk-in Introduction2-1.
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.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
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#
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Introduction 1. CIS 400 Programming for the Windows Environment 2.
Languages and IDE (Integrated Development Environment)
Introduction to Exception Handling and Defensive Programming.
1 C# A brief overview by Jack Senechal and Bryan Powell.
Rajiv and Shipra Introduction to.NET (asp.net,c#,vb)
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Compunet Corporation1 Programming with Visual Basic.NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Microsoft .NET A platform that can be used for building and running windows and web applications such that the software is platform and device-independent.
BIL527 – Bilgisayar Programlama I Introduction 1.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
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# Programming with Microsoft.NET AY
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Lecture 2 Computational Constructs Variables & Expressions Boolean Logic Conditionals: if & switch Branching & Looping Data Types & Type Conversion Structs,
D OTNET ONLINE TRAINING. DOTNET Online Training Course Content : Introduction to.Net Online Training NET FUNDAMENTALS Why Dot Net? The Dot Net initiative.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
C# Diline Giriş.
Introduction to .NET Framework
C# and the .NET Framework
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
Advanced Programming Lecture 02: Introduction to C# Apps
IS 135 Business Programming
Presentation transcript:

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 applications work ➤ What C# is and how it relates to the.NET Framework ➤ What tools are available for creating.NET applications with C#

Included in Visual Studio.NET Visual Basic (VB.Net, VB 7.0) C++ C# (đọc là C Sharp) J# (J Sharp).NET Framework Windows Programming 1 Chapter 1: Introducing C#Slide 2

Install Visual Studio.NET 2010 Windows Programming 1 Chapter 1: Introducing C#Slide 3 Chạy file setup.exe ta được hình minh họa (chú ý cài khá lâu có thể hơn 45phút)

Install Visual Studio.NET 2010 Windows Programming 1 Chapter 1: Introducing C#Slide 4 Trên windows XP phải Service pack3

Install Visual Studio.NET 2010 Windows Programming 1 Chapter 1: Introducing C#Slide 5 Trên windows XP phải Service pack3 Chú ý Nên chọn full

WHAT IS THE.NET FRAMEWORK? Understanding the.NET Framework Architecture Windows Programming 1Chapter 1: Introducing C#Slide 6

WHAT IS THE.NET FRAMEWORK? Common Language Runtime Architecture Windows Programming 1Chapter 1: Introducing C#Slide 7

WHAT IS THE.NET FRAMEWORK? Microsoft’s modern software development platform Supports several programming languages, including C#, Visual Basic, C++, J# Programs executed by Common Language Runtime (CLR) Includes a large library of components (classes) which can be used in programs Windows Programming 1Chapter 1: Introducing C#Slide 8

Writing Applications Using the.NET Framework CIL (Common Intermediate Language code.), JIT (just-in-time compiler) MSIL or IL (Microsoft Intermediate Language ) Assemblies Managed Code Garbage Collection Windows Programming 1Chapter 1: Introducing C#Slide 9

Writing Applications Using the.NET Framework Windows Programming 1Chapter 1: Introducing C#Slide 10 C# Code C# Compiler Visual Basic Code Visual Basic Compiler COBOL Code COBOL Compiler IL JIT Compiler Native Code

Writing Applications Using the.NET Framework Windows Programming 1Chapter 1: Introducing C#Slide 11

WHAT IS C#? Applications You Can Write with C# Windows applications Web applications: Web services: Windows Programming 1Chapter 1: Introducing C#Slide 12

Visual Studio Powerful, professional Integrated Development Environment (IDE) Integrates compilers, debugger and many other useful tools for development Can work with many different types of project, including: Console (text-based) applications Windows (GUI) applications Web applications (ASP.NET) Class libraries Windows Programming 1Chapter 1: Introducing C#Slide 13

Visual Studio Solution explorer Toolbox windows Visual designer Properties windows Windows Programming 1Chapter 1: Introducing C#Slide 14

Visual Studio projects A project contains source code files, settings and resources for an application May contain references to class libraries May contain data used by application Building a project: Compiles source files Copies non-source files to output folder Creates an assembly in output folder Building a solution builds all its projects Windows Programming 1Chapter 1: Introducing C#Slide 15

Project details References – class libraries used by this application References – class libraries used by this application Solution folder contents Project folder contents Solution file (.sln) and project file (.csproj) are created by VS and contain solution/project configuration information Windows Programming 1Chapter 1: Introducing C#Slide 16

Creating a Visual Studio project Demo Windows Programming 1Chapter 1: Introducing C#Slide 17

SUMMARY Windows Programming 1Chapter 1: Introducing C#Slide 18

Week 1: THE C# LANGUAGE Chapter 2: Writing a C# Program  A basic working knowledge of Visual Studio 2010 and Visual C# 2010 Express Edition  How to write a simple console application  How to write a Windows Forms application

Visual C# 2010 Ultimate Windows Programming 1 Chapter 2: Writing a C# Program Slide 20

CONSOLE APPLICATIONS Windows Programming 1 Chapter 2: Writing a C# Program Slide 21

WINDOWS FORMS APPLICATIONS Windows Programming 1 Chapter 2: Writing a C# Program Slide 22

The Solution Explorer Windows Programming 1 Chapter 1: Introducing C#Slide 23

The Properties Window Windows Programming 1 Chapter 1: Introducing C#Slide 24

Code view Windows Programming 1 Chapter 1: Introducing C#Slide 25

The Error List Window Windows Programming 1 Chapter 1: Introducing C#Slide 26

SUMMARY Windows Programming 1 Chapter 2: Writing a C# Program Slide 27

Week 1: THE C# LANGUAGE Chapter 3:Variables and Expressions Basic C# syntax Variables and how to use them Expressions and how to use them

BASIC C# SYNTAX The look and feel of C# code is similar to that of C++ and Java. C# compilers ignore additional spacing in code, whether it results from spaces, carriage returns, or tab characters (collectively known as whitespace characters). Statements C# is a block-structured language, meaning statements are part of a block of code. Windows Programming 1 Chapter3: Variables and Expressions Slide 29

block These blocks, which are delimited with curly brackets ({ and }), may contain any number of statements, or none at all Windows Programming 1 Chapter3: Variables and Expressions Slide 30

comments Comments can be created using //… Multi-lines comments use /* … */ You can use single-line comments that start with three / symbols instead of two /// A special comment Comments are ignored by the compiler Used only for human readers Windows Programming 1 Chapter3: Variables and Expressions Slide 31

The code outlining You can do this with the #region and #endregion keywords, which define the start and end of a region of code that can be expanded and collapsed. Windows Programming 1 Chapter3: Variables and Expressions Slide 32

VARIABLES C# syntax for declaring variables merely specifies the type and variable name: ; int intNumberOfStudents; Declaration includes Name, follow Naming Convention Rules Data Type Required Value for Constants Optional Initial Value for Variables Windows Programming 1 Chapter3: Variables and Expressions Slide 33

Simple Types Windows Programming 1 Chapter3: Variables and Expressions Slide 34

Simple Types Windows Programming 1 Chapter3: Variables and Expressions Slide 35

Simple Types Windows Programming 1 Chapter3: Variables and Expressions Slide 36

Using Simple Type Variables Windows Programming 1 Chapter3: Variables and Expressions Slide 37

Variable Naming The first character of a variable name must be either a letter, an underscore character ( _ ), or the at symbol Subsequent characters may be letters, underscore characters, or numbers. Windows Programming 1 Chapter3: Variables and Expressions Slide 38

String Literals Windows Programming 1 Chapter3: Variables and Expressions Slide 39

String Literals This means that the following strings are equivalent: "Karli \’s string." "Karli \u0027 s "A short list: item 1 item 2“ "C:\Temp\MyDir\MyFile.doc" Windows Programming 1 Chapter3: Variables and Expressions Slide 40

EXPRESSIONS Operators can be roughly classified into three categories: ➤ Unary— Act on single operands ➤ Binary—Act on two operands ➤ Ternary—Act on three operands Windows Programming 1 Chapter3: Variables and Expressions Slide 41

Mathematical Operators Windows Programming 1 Chapter3: Variables and Expressions Slide 42

Windows Programming 1 Chapter3: Variables and Expressions Slide 43

Manipulating Variables with Mathematical Operators Windows Programming 1 Chapter3: Variables and Expressions Slide 44

Assignment Operators Windows Programming 1 Chapter3: Variables and Expressions Slide 45

Operator Precedence Windows Programming 1 Chapter3: Variables and Expressions Slide 46

Namespaces Namespaces are also used as a means of categorizing items in the.NET Framework C# code, by default, is contained in the global namespace Qualified names use period characters (.) between namespace levels System.Int32 Windows Programming 1 Chapter3: Variables and Expressions Slide 47

Namespaces Windows Programming 1 Chapter3: Variables and Expressions Slide 48 Code in the global namespace, however, must refer to this name using the classified name LevelOne.NameOne.

Namespaces Within a namespace, you can define nested namespaces, also using the namespace keyword. Windows Programming 1 Chapter3: Variables and Expressions Slide 49

SUMMARY Windows Programming 1 Chapter 3: Variables and Expressions Slide 50