Windows Programming 1 Part 1 dbg --- Getting Acquainted with Visual Studio.NET and C#

Slides:



Advertisements
Similar presentations
An Introduction to Visual Basic Terms & Concepts.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
Object Oriented System Development with VB .NET
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Introduction to the C# Programming Language for the VB Programmer.
C# Programming: From Problem Analysis to Program Design1 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
ASP.NET Programming with C# and SQL Server First Edition
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.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
CIS205 Part 1 dbg --- Getting Acquainted with Visual Studio.NET and C#
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
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.
Overview of Microsoft.Net and Vb.Net ITSE 2349 Spring 2002 Material from Microsoft.Net an Overview for ACC faculty by Stuart Laughton and Introduction.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
1 Why C# and Why.NET in the Undergraduate IS Curriculum ISECON November 3 -7, 2004, Newport, RI Association of Information Technology Professionals Mehdi.
A First Program Using C#
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
CSCI 3327 Visual Basic Chapter 1: Introduction to Visual Basic
Object Oriented Programming CEN 221. Course Description Classes, objects, inheritance, polymorphism, graphical user interfaces, event handling, exception.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
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.
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
Session 1 - Introduction and Data Access Layer
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
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.
Neal Stublen Class Objectives  Develop an understanding of the.NET Framework  Gain proficiency using Visual Studio  Begin learning.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
An Object-Oriented Approach to Programming Logic and Design
An Introduction to Visual Basic
Integrated Development Environment (IDE)
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.
Introduction to .NET Framework
Introduction to VB.Net. What is.NET? A brand of Microsoft technologies A platform for creating distributed Web applications A combination of new and updated.
1 Visual Studio.NET.NET as a Teaching Tool John D. Haney John M. Lovely Northern Arizona University College of Business Administration.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
Chapter Eleven Classes and Objects Programming with Microsoft Visual Basic th Edition.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Chapter 6 OOP: Creating Object-Oriented Programs Programming In Visual Basic.NET.
Compunet Corporation1 Programming with Visual Basic.NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz.
1.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
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.
COMPUTER III. Fundamental Concepts of Programming Control Structures Sequence Selection Iteration Flowchart Construction Introduction to Visual Basic.
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
Introduction to Visual Basic 2008 Programming
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to .NET Framework Ch2 – Deitel’s Book
An Introduction to Visual Basic
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
CIS16 Application Development Programming with Visual Basic
Presentation transcript:

Windows Programming 1 Part 1 dbg --- Getting Acquainted with Visual Studio.NET and C#

2 The Visual Studio.NET IDE Visual Studio.NET is an Integrated Development Environment (IDE). It contains: –the Designer which makes it easy to create Graphical User Interfaces (GUIs) –a context-sensitive text editor –various language compilers (we will be using C#) –a runtime environment for testing/debugging our code Visual Studio.NET can be used with other programming languages such as C++ and Visual Basic

3 Programming Windows with.NET.NET is a “programming platform” for Windows. An important feature is that applications are especially “tuned” for network use. Another interesting feature is that the platform allows applications written with several different languages to directly communicate with each other.

4 The.NET Framework Common Language Specification ASP.NET: Web Services and Web Forms Windows Forms ADO.NET: Data and XML Framework Class Library Common Language Runtime VB C++ C# J# … Visual Studio.NET

Procedural programming + classes Where Does C# Fit? BCPL B C C++ C++ C++.NET BASIC Visual BASIC BASIC.NET MS Visual C# combines the best features of C/C++, Java, and VB in a new visual, fully object-oriented, event- driven programming language designed for use with the.NET platform. Procedural programming + classes MS Sun Microsystems Java GUIs Web Programming Fully OOP ANSI/ISO MS Visual C#.NET

6 Programming Windows with C# A new language designed specifically for.NET Fully object-oriented Type safe language Built-in Visual Editor for GUI development Fundamental programming syntax resembles that of C++ and Java

7 Importance of C# Microsoft wrote much of.NET system programming in C# and is currently writing next version of Windows (Longhorn) in C#. In “Special Report: Security”, PC Magazine, pg 78, 8/3/04 issue: “ ‘In the course of putting together Longhorn,’ says Nash, [of Microsoft] ‘… we’re making sure that in the design phase, the implementation phase, as we build the product, we’re looking for security and quality issues.’ The company is also using design tools that are far more conducive to building secure code. It has discarded notoriously insecure languages like C and C++ in favor of C# and the Microsoft.NET platform.”

8 C# Features A considerable amount of pre-defined code resides in the Framework Class Library (FCL). C# can be used to develop –Console applications (procedural programming) –Interactive Windows Forms applications (GUIs) –Web Services (server programs) –Interactive Web Forms (via ASP.NET) Like other.NET languages, code is compiled first into MSIL (MS Intermediary Language) and then into machine language.

Objects Getting Started with Object Oriented Programming

10 Objects (nouns) An object is a person, place or thing. In theory, we should be able to describe all of our experience and surroundings as objects. All objects have attributes and operations.

11 Attributes (adjectives) Attributes are characteristics. Use attributes to describe the appearance of an object. Size, shape and color could be attributes of many objects. A football is brown in color and roughly oval in shape; these characteristics represent values assigned to attributes.

12 Operations (verbs) Operations are actions. User operations to describe the “active” behavior of an object. A football might, spiral, tumble, roll or bounce. These behaviors become evident if a specific operation of the object is activated.

13 Classes (templates) Classes are patterns for objects. You might think of a class as a cookie cutter and a set of objects as cookies created with that cutter (class). An object is an instance of a class, and the process of creating an object is called instantiation. Class Objects

14 Classes In practice, a class is a unit or module of code that may be used to define the attributes and operations of an object. Some classes will exist within the Windows applications we will write. Other classes pre-exist and are stored in special files called libraries.

15 Data and Actions Within a class, attributes are represented by variables. After an object is created from a class, values may be assigned to these variables to adjust attributes. Within a class, operations are represented by methods. After an object is created from a class, an operation may be triggered by running a method.

16 Encapsulation It is not necessary for a programmer who uses a pre-existing class to know or understand its code structure. This concept is called encapsulation; its implications are significant.

17 A Class Interface The implementation code of a class is encapsulated (hidden from view). Properties define the characteristics (data) of an object. Methods are operations that an object can perform. Properties and methods can be referred to as members of an object/class.

18 Visual Studio Icons PropertyNamespace EventClass MethodConstant

19 Syntax for Using Properties and Methods Programmers use dot notation to gain access to properties and methods. To assign a value to a property of an object: object. property = value To run a method (function) of an object: object. method Remember: methods (functions) always have parentheses!

C# Programming A Simple Windows Application Programmed with C#

21 Create Objects with the FCL At this point, we know nothing of the structure of the classes in the Framework Class Library. If we know the identity of just some of the attributes (properties) and operations (methods) we wish to use, we should be able to create and manipulate an object.

22 Namespaces Large libraries of classes are arranged into sub libraries of related classes. These sub libraries are called namespaces..NET programs are organized into projects, where each project normally comprises a namespace.

23 Inheriting a Class from the FCL Sometimes an existing class does almost, or nearly what we want. We can create our own class and inherit the contents of the original class.

24 Running a Method The Main() method indicates which object runs automatically at startup time. In.NET 2005, the Main() method will reside in a file named Program.cs. In this example, our form class is the startup object. We are activating the Run() method of the Application object from the System.Windows.Forms namespace.

25 Running a Method The Run() method within the Application class requires an argument or parameter. We pass the keyword new and the name of our form class as the function argument. Main() is always capitalized!

26 Assigning a Property Value Our form has a Text property. The value stored in the Text property of a Form will appear in the title bar of the form.

27 Assigning a Property Value Any property value assignments must be made within functions. We are making our text property assignment within a special function called the constructor.

28 The Constructor Function In C#, the constructor function has the same name as the class itself. The constructor may have optional arguments (parameters), if desired. The constructor runs at the instant an object is created from a class — instantiation. Code in the constructor function can set the initial values of variables and properties. An object of our class is instantiated at startup of the project.