Lecture 1 Programming in C# Introducing C# Writing a C# Program.

Slides:



Advertisements
Similar presentations
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Advertisements

© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Introduction to the C# Programming Language for the VB Programmer.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
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.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
A First Program Using C#
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Introduction to VB.NET Tonga Institute of Higher Education.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Introduction to .Net Framework
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.
CSC300 Visual Programming Dr. Craig Reinhart. Objectives Teach the basics of C++ –You won’t be an expert but hopefully a very good novice –GUI development.
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.
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Module 1: Introduction to C# Module 2: Variables and Data Types
 2002 Prentice Hall. All rights reserved. 1 Introduction to Visual Basic.NET,.NET Framework and Visual Studio.NET Outline 1.7Introduction to Visual Basic.NET.
Session 1 - Introduction and Data Access Layer
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.
CSC 494/594 C# and ASP.NET Programming. C# 2012 C# Object-oriented language with syntax that is similar to Java.
IE 411/511: Visual Programming for Industrial Applications
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.
Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
CSCI 3328 Object Oriented Programming in C# Chapter 1: Introduction to C# Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
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.
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.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 17 Microsoft’s Approach 1 –.NET Mobile Framework Rob Pooley.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
BIL527 – Bilgisayar Programlama I Introduction 1.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Introduction to C# Programming with Microsoft.NET AY
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Introducing the Microsoft® .NET Framework
Dive Into® Visual Basic 2010 Express
Introduction to Visual Basic 2008 Programming
Introduction to .NET Framework Ch2 – Deitel’s Book
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
Lecturer: Mukhtar Mohamed Ali “Hakaale”
CIS16 Application Development – Programming with Visual Basic
IS 135 Business Programming
C# and ASP.NET Programming
Presentation transcript:

Lecture 1 Programming in C# Introducing C# Writing a C# Program

C# is a relatively new language that was unveiled to the world when Microsoft announced the first version of its.NET Framework in July Since then its popularity has rocketed, and it has arguably become the language of choice for both Windows and Web developers who use the.NET Framework. Part of the appeal of C# comes from its clear syntax, which derives from C/C++ but simplifies some things that have previously discouraged some programmers. Despite this simplification, C# has retained the power of C++, and there is now no reason not to move into C#. The language is not difficult and it’s a great one to learn elementary programming techniques with. This ease of learning, combined with the capabilities of the.NET Framework, make C# an excellent way to start your programming career. Introduction

➤ Introduction: Purpose and general outline of the book’s contents ➤ The C# Language: Covers all aspects of the C# language, from the fundamentals to object oriented techniques ➤ Windows Programming: How to write Windows applications in C# and deploy them ➤ Data Access: How to use data in your applications, including data stored in files on your hard disk, data stored in XML format, and data in databases ➤ Additional Techniques: An examination of some extra ways to use C# and the.NET framework, including WPF, WCF, and WF—technologies introduced with.NET 3.0 and enhanced for.NET 4. What We Will Cover in this Course

The.NET Framework consists primarily of a gigantic library of code that you use from your client languages (such as C#) using object-oriented programming (OOP) techniques. This library is categorized into different modules — you use portions of it depending on the results you want to achieve. As well as supplying this library, the.Net Framework also includes the.NET Common Language Runtime (CLR), which is responsible for maintaining the execution of all applications developed using the.NET library. The.NET Framework

When you compile code that uses the.NET Framework library, you don’t immediately create operating-system-specific native code. Instead, you compile your code into Common Intermediate Language (CIL) code. The job of a just-in-time (JIT) compiler is to compile the CIL into native code that is specific to the OS and machine architecture being targeted. CIL and JIT

The role of the CLR doesn’t end after you have compiled your code to CIL and a JIT compiler has compiled that to native code. Code written using the.NET Framework is managed when it is executed (a stage usually referred to as runtime). This means that the CLR looks after your applications by managing memory, handling security, allowing cross-language debugging, and so on. By contrast, applications that do not run under the control of the CLR are said to be unmanaged, and certain languages such as C++ can be used to write such applications, which, for example, access low-level functions of the operating system. In C# you can write only code that runs in a managed environment. You will make use of the managed features of the CLR and allow.NET itself to handle any interaction with the operating system. Managed Code

One of the most important features of managed code is the concept of garbage collection. This is the.NET method of making sure that the memory used by an application is freed up completely when the application is no longer in use..NET garbage collection works by periodically inspecting the memory of your computer and removing anything from it that is no longer needed. There is no set time frame for this; it might happen thousands of times a second, once every few seconds, or whenever, but you can rest assured that it will happen. Garbage Collection

From Source Code to Executable Application is written using C# Code is compiled to CIL Before execution, CIL code is compiled to native code using JIT compiler. Native code is executed within the CLR

In this book, you use the Visual Studio 2010 (VS) or Visual C# 2010 Express (VCE) development tools for all of your C# programming, from simple command-line applications to more complex project types. A development tool, or integrated development environment (IDE), such as VS isn’t essential for developing C# applications, but it makes things much easier. It is possible to manipulate C# source code files in a basic text editor, such as the ubiquitous Notepad application, and compile code into assemblies using the command-line compiler that is part of the.NET Framework. Visual Studio 2010

Console Applications You use console applications regularly in this book, particularly at the beginning, so the Try It Out on page 18 provides a step-by-step guide to creating a simple one. It includes instructions for both VS and VCE. If you have not used the VS 2010 IDE before make sure you complete this example exercise. namespace ConsoleApplication1 { class Program { static void Main(string[] args) { // Output text to the screen. Console.WriteLine("The first app in Beginning C# Programming!"); Console.ReadKey(); }

The Solution Explorer window is in the top-right corner of the screen. By default, this window is set to auto-hide, but you can dock it to the side of the screen by clicking the pin icon when it is visible. The Solution Explorer window shares space with another useful window called Class View, which you can display using View ➪ Class View. You can toggle between these two windows by clicking on the tabs at the bottom of the window when the window is docked. The Solution Explorer

The Properties window (select View ➪ Properties Window if it isn’t already displayed) shows additional information about whatever you select in the window above it. This window also displays information about other selected items, such as user interface components (as shown in the ‘‘Windows Forms Applications’’ section of this chapter). Often, changes you make to entries in the Properties window affect your code directly, adding lines of code or changing what you have in your files. With some projects, you spend as much time manipulating things through this window as making manual code changes. The Properties Window

It is often easier to demonstrate code by running it as part of a Windows application than through a console window or via a command prompt. You can do this using user interface building blocks to piece together a user interface. The Try It Out on page 24 shows just the basics of doing this, and you’ll see how to get a Windows application up and running without a lot of details about what the application is actually doing. If you are new to VS 2010 and Windows Forms Application development, make sure you complete this exercise. Windows Forms Applications