Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.

Slides:



Advertisements
Similar presentations
Unit 1: Overview of the Microsoft.NET Platform
Advertisements

.NET Framework Overview
Integrated Development Environments, Source Control Repositories, Automated Testing Tools, Bug Tracking, Code Analysis Tools, Build Tools, Project Hosting.
.NET Framework Overview
Windows Programming 1 Part 1 dbg --- Getting Acquainted with Visual Studio.NET and C#
.NET Technology.
Introduction to.NET What is.NET?  A vision Web sites will be joined by Web services New smart devices will join the PC User interfaces will become more.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
Revealing the CLR 4.0 Internals Svetlin Nakov Telerik Corporation
Introduction to the C# Programming Language for the VB Programmer.
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program C# Programming: From Problem Analysis to Program Design 2 nd Edition.
Introduction to Computing and Programming
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
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.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
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.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
A First Program Using C#
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
Introduction to Programming
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
High thoughts must have high language. Aristophanes
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
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
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
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
.NET Framework Overview
C# Overview and Features. Content I.History of C# II.Architecture III.How to install IV.Features V.Code Sample VI.Microsoft.NET Platform VII.Why use C#
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#
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.
1.1 Introduction to Programming academy.zariba.com 1.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Creating and Running Your First C# Program Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
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.
ISYS 512 Business Application Design and Development with.Net David Chao.
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.
.NET Framework, CLR, MSIL, Assemblies, CTS, etc..
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Exploring Networked Data and Data Stores Lesson 3.
C# Diline Giriş.
C# Programming: From Problem Analysis to Program Design
Introduction ITEC 420.
Introducing the Microsoft® .NET Framework
.NET Framework 2.0 .NET Framework 3.0 .NET Framework 3.5
Introduction to Visual Basic 2008 Programming
C# and the .NET Framework
Introduction to .NET Framework Ch2 – Deitel’s Book
CS360 Windows Programming
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
IS 135 Business Programming
Presentation transcript:

Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy

1. What is Computer Programming? 2. Your First C# Program 3. What is.NET Framework? 4. What is Visual Studio? 5. What is MSDN Library? 2

Computer programming: creating a sequence of instructions to enable the computer to do something 4 Definition by Google

 Define a task/problem  Plan your solution  Find suitable algorithm to solve it  Find suitable data structures to use  Write code  Fix program error (bugs)  Make your customer happy 5 = Specification = Design = Implementation = Testing & Debugging = Deployment

Sample C# program: using System; class HelloCSharp { static void Main() static void Main() { Console.WriteLine("Hello, C#"); Console.WriteLine("Hello, C#"); }} 7

8 using System; class HelloCSharp { static void Main() static void Main() { Console.WriteLine("Hello, C#"); Console.WriteLine("Hello, C#"); }} Include the standard namespace " System " Define a class called " HelloCSharp " Define the Main() method – the program entry point Print a text on the console by calling the method " WriteLine " of the class " Console "

9 using System; class HelloCSharp { static void Main() static void Main() { Console.WriteLine("Hello, C#"); Console.WriteLine("Hello, C#"); }} The { symbol should be alone on a new line. The block after the { symbol should be indented by a TAB. The } symbol should be under the corresponding {. Class names should use PascalCase and start with a CAPITAL letter.

10 using usingSystem ; class HelloCSharp { class HelloCSharp { static static void Main( ) { Console. WriteLine ("Hello, C#" ) ;Console. WriteLine ( "Hello again" WriteLine ( "Hello again" ) ;}} ) ;}} Such formatting makes the source code unreadable.

 Programming language  A syntax that allow to give instructions to the computer  C# features:  New cutting edge language  Extremely powerful  Easy to learn  Easy to read and understand  Object-oriented 11

 Knowledge of a programming language  C#  Task to solve  Development environment, compilers, SDK  Visual Studio,.NET Framework SDK  Set of useful standard classes  Microsoft.NET Framework FCL  Help documentation  MSDN Library 12

Live Demo

 Environment for execution of.NET programs  Powerful library of classes  Programming model  Common execution engine for many programming languages  C#  Visual Basic.NET  Managed C++ ... and many others 15

 Building blocks of.NET Framework Operating System (OS) Common Language Runtime (CLR) Base Class Library (BCL) ADO.NET, EF, LINQ and XML (Data Tier) WCF and WWF (Communication and Workflow Tier) ASP.NET Web Forms, MVC, Web API, SignalR WindowsForms WPF / XAML WinJS / Win8 C#C++VB.NETJ#F#PHPPerl Delphi… 16 FCL CLR

 Common Language Runtime (CLR)  Managed execution environment  Executes.NET applications  Controls the execution process  Automatic memory management (garbage collection)  Programming languages integration  Multiple versions support for assemblies  Integrated type safety and security 17 CLR

 Framework Class Library (FCL)  Provides basic functionality to developers:  Console applications  WPF and Silverlight rich-media applications  Windows Forms GUI applications  Web applications (dynamic Web sites)  Web services, communication and workflow  Server & desktop applications  Applications for mobile devices 18

 Visual Studio – Integrated Development Environment (IDE)  Development tool that helps us to:  Write code  Design user interface  Compile code  Execute / test / debug applications  Browse the help  Manage project's files 20

 Single tool for:  Writing code in many languages (C#, VB, …)  Using different technologies (Web, WPF, …)  For different platforms (.NET CF, Silverlight, …)  Full integration of most development activities (coding, compiling, testing, debugging, deployment, version control,...)  Very easy to use! 21

22

Compiling, Running and Debugging C# Programs

1. File  New  Project Choose C# console application 3. Choose project directory and name 24

4. Visual Studio creates some source code for you 25 Namespace not required Class name should be changed Some imports are not required

 The process of compiling includes:  Syntactic checks  Type safety checks  Translation of the source code to lower level language (MSIL)  Creating of executable files (assemblies)  You can start compilation by  Using Build->Build Solution/Project  Pressing [F6] or [Shift+Ctrl+B] 26

 The process of running application includes:  Compiling (if project not compiled)  Starting the application  You can run application by:  Using Debug->Start menu  By pressing [F5] or [Ctrl+F5] * NOTE: Not all types of projects are able to be started! 27

 The process of debugging application includes:  Spotting an error  Finding the lines of code that cause the error  Fixing the code  Testing to check if the error is gone and no errors are introduced  Iterative and continuous process 28

 Visual Studio has built-in debugger  It provides:  Breakpoints  Ability to trace the code execution  Ability to inspect variables at runtime 29

Compiling, Running and Debugging C# Programs Live Demo

Creating a Solution Without Projects

 A Visual Studio blank solution  Solution with no projects in it  Projects to be added later  What is the point?  Not making a project just to give proper name  And not working in this project

33

Live Demo

 Complete documentation of all classes and their functionality  With descriptions of all methods, properties, events, etc.  With code examples  Related articles  Library of samples  Use local copy or the Web version at

37

 Offline version (obsolete)  Use the table of contents  Use the alphabetical index  Search for phrase or keyword  Filter by technology  Browse your favorite articles  Online version  Use the built-in search: [F 1 ] 38

Browsing and Searching Documentation Live Demo

Questions?

1. Familiarize yourself with:  Microsoft Visual Studio  Microsoft Developer Network (MSDN) Library Documentation  Find information about Console.WriteLine() method. 2. Create, compile and run a “Hello C#” console application. 3. Modify the application to print your name. 4. Write a program to print the numbers 1, 101 and

5. Install at home:  Microsoft Visual Studio (or Visual Studio Express) 6. Create console application that prints your first and last name. 7. Create a console application that prints the current date and time. 8. Create a console application that calculates and prints the number raised to the power of Write a program that prints the first 10 members of the sequence: 2, -3, 4, -5, 6, -7,... 42

10. Provide a short list with information about the most popular programming languages. How do they differ from C#? 11. Describe the difference between C# and.NET Framework. 12. * Write a program to read your age from the console and print how old you will be after 10 years. 43 * NOTE: If you have any difficulties, search in Google.

 Fundamentals of C# Programming Track of Courses  csharpfundamentals.telerik.com csharpfundamentals.telerik.com  Telerik Software Academy  academy.telerik.com academy.telerik.com  Telerik Facebook  facebook.com/TelerikAcademy facebook.com/TelerikAcademy  Telerik Software Academy Forums  forums.academy.telerik.com forums.academy.telerik.com