SlideShare a Scribd company logo
Renas R. Rekany Object-Oriented-Programming L1A
1
Object-Oriented-Programming
Stage: Second Computer
Science
Department
Computer &
I.T Faculty
Units
8
Hours
Theoretical 2,
Practical 2
Tutorial 2
OOP
Lec: Renas R. Rekany
2015/2016
Renas R. Rekany Object-Oriented-Programming L1A
2
History of programming languages
1- Microsoft .Net Framework
.NET Framework (pronounced dot net) is a software framework developed by Microsoft that
runs primarily on Microsoft Windows. It includes a large class library known as Framework
Class Library (FCL) and provides language interoperability(each language can use code written
in other languages) across several programming languages. Programs written for .NET
Framework execute in a software environment (as contrasted to hardware environment), known
as Common Language Runtime (CLR), an application virtual machine that provides services
such as security, memory management, and exception handling. FCL and CLR together
constitute .NET Framework.
FCL provides user interface, data access, database connectivity, cryptography, web
application development, numeric algorithms, and network communications.
Programmers produce software by combining their own source code with .NET
Framework and other libraries. .NET Framework is intended to be used by most new
applications created for the Windows platform. Microsoft also produces an integrated
development environment largely for .NET software called Visual Studio.
2-Different DOTNET Types of Applications
There are three main types of application that can be written in C#:
1. Winforms : Windows applications have the familiar graphical user interface
of Windows with controls such as buttons and list boxes for input.
2. Console: Console applications use standard command-line input and output
for input and output instead of a form.
[[[[
Renas R. Rekany Object-Oriented-Programming L1A
3
3. Web Sites.
3- Starting Visual Studio (2008/2015)
-Double click on Microsoft Visual Studio (2008/2015) icon on desktop.
OR
-Open the Start menu, select All Programs, and then select Microsoft Visual Studio 2008/2015.
Renas R. Rekany Object-Oriented-Programming L1A
4
Renas R. Rekany Object-Oriented-Programming L1A
5
4- Create First Winforms application
Step 1: Start Visual Studio
Open the Microsoft Visual Studio 2008/2015.
Step 2: Create a new project
Go to File -> New Project, And then New Project Dialog Appears.
In the New Project Window, Select Visual C# as Project type and Windows Forms
Applications as the template. Give Name and Location to your project and finally
click OK button to create our first C# project.
Renas R. Rekany Object-Oriented-Programming L1A
6
Step 3: Design the user interface.
When the project is created, you will see the designer view of your interface as
follows.
Form Designer View
Renas R. Rekany Object-Oriented-Programming L1A
7
In this designer view of the form (Form1.cs [Design]), you can design the user
interface of the single form. To do that, we use the 'Toolbox' which contains the
items that you can add to your form. Toolbox is placed on the left side of your
visual studio. If it is not visible go to View -> Toolbox to show the Toolbox.
Toolbox
It contains Labels, Buttons, Check Boxes, Combo Boxes and etc. This can be used
to design your interface. To add elements from the Toolbox to your form double
click the item or drag the item to your form.
Now add a Button Control to your form by simple dragging a Button control into
the form designer view. Finally it looks like below.
Now our form contains two elements. Those are form and the button control.
These elements have properties such as name, text, background color, fore color,
Renas R. Rekany Object-Oriented-Programming L1A
8
etc.... To see properties for a control, select the control and all the properties are
displayed in the Properties Window which appears on the right side of your visual
studio. If it is not visible, Go to View -> Properties Window.
Select the button and view properties as follows.
Now set the text to 'Show' for the button.
Renas R. Rekany Object-Oriented-Programming L1A
9
Step 4: Writing the code
Double click on buttun1 to write the code
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World!");
}
Step 5: Compile the code
To compile the code Go to Build -> Build HelloWorld
Step 6: Running the application
To run/execute the program press F5.
Running Application.
Renas R. Rekany Object-Oriented-Programming L1A
10
6- Create First Web application
Building Your First Web Application Project
Creating a New Project
Select File->New Project within the Visual Studio 2005 IDE. This will bring up the New Project
dialog. Click on the “Visual C#” node in the tree-view on the left hand side of the dialog box and
choose the "ASP.NET Web Application" icon:
Visual Studio will then create and open a new web project within the solution explorer. By
default it will have a single page (Default.aspx), an AssemblyInfo.cs file, as well as a web.config
file. All project file-meta-data is stored within a MSBuild based project file.
Renas R. Rekany Object-Oriented-Programming L1A
11
Opening and Editing the Page
Double click on the Default.aspx page in the solution explorer to open and edit the page. You
can do this using either the HTML source editor or the design-view. Add a "Hello world" header
to the page, along with a calendar server control and a label control (we'll use these in a later
tutorial):
Renas R. Rekany Object-Oriented-Programming L1A
12
Build and Run the Project
Hit F5 to build and run the project in debug mode. By default, ASP.NET Web Application
projects are configured to use the built-in VS web-server when run. The default project
templates will run on a random port as a root site (for example: http://localhost:12345/):
Renas R. Rekany Object-Oriented-Programming L1A
13
You can end the debug session by closing the browser window, or by choosing the Debug->Stop
Debugging (Shift-F5) menu item.
Customizing Project Properties
ASP.NET Web Application Projects share the same configuration settings and behaviors as
standard VS 2005 class library projects. You access these configuration settings by right-clicking
on the project node within the Solution Explorer in VS 2005 and selecting the "Properties"
context-menu item. This will then bring up the project properties configuration editor. You can
use this to change the name of the generated assembly, the build compilation settings of the
project, its references, its resource string values, code-signing settings, etc:
Renas R. Rekany Object-Oriented-Programming L1A
14
ASP.NET Web Application Projects also add a new tab called "Web" to the project properties
list. Developers use this tab to configure how a web project is run and debugged. By default,
ASP.NET Web Application Projects are configured to launch and run using the built-in VS Web
Server (aka Cassini) on a random HTTP port on the machine.
This port number can be changed if this port is already in use, or if you want to specifically test
and run using a different number:
Renas R. Rekany Object-Oriented-Programming L1A
15
Alternatively, Visual Studio can connect and debug IIS when running the web application. To
use IIS instead, select the "Use IIS Web Server" option and enter the url of the application to
launch, connect-to, and use when F5 or Control-F5 is selected:
Renas R. Rekany Object-Oriented-Programming L1A
16
Then configure the url to this application in the above property page for the web project. When
you hit F5 in the project, Visual Studio will then launch a browser to that web application and
automatically attach a debugger to the web-server process to enable you to debug it.
Note that ASP.NET Web Application Projects can also create the IIS vroot and configure the
application for you. To do this click the "Create Virtual Directory" button.

More Related Content

What's hot

Best practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netBest practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.net
ajmal_fuuast
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 
Introduction to visual basic
Introduction to visual basicIntroduction to visual basic
Introduction to visual basicManav Khandelwal
 
SharePoint 2010 For Developers
SharePoint 2010 For DevelopersSharePoint 2010 For Developers
SharePoint 2010 For Developers
Sparked
 
Creating a data report in visual basic 6
Creating a data report in visual basic 6Creating a data report in visual basic 6
Creating a data report in visual basic 6mrgulshansharma
 
Wpf 1
Wpf 1Wpf 1
Flex Framework Presentation PPT
Flex Framework Presentation PPTFlex Framework Presentation PPT
Flex Framework Presentation PPT
Constantin Stan
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 IntroductionTennyson
 
Arthur Del Prado .Net Portfolio
Arthur Del Prado .Net PortfolioArthur Del Prado .Net Portfolio
Arthur Del Prado .Net Portfolio
artsdp
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
Spy Seat
 
Vb unit t 1.1
Vb unit t 1.1Vb unit t 1.1
Vb unit t 1.1
Gayathri Cit
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
Saad Wazir
 
Jeff Huber Portfoilio
Jeff Huber PortfoilioJeff Huber Portfoilio
Jeff Huber Portfoilio
JeffHuber
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
Fajar Baskoro
 
Asp.net
Asp.netAsp.net
Asp.net
vijilakshmi51
 
Delphi for PHP “In Action”
Delphi for PHP “In Action”Delphi for PHP “In Action”
Delphi for PHP “In Action”
Embarcadero Technologies
 

What's hot (20)

Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
Best practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netBest practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.net
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 
Introduction to visual basic
Introduction to visual basicIntroduction to visual basic
Introduction to visual basic
 
SharePoint 2010 For Developers
SharePoint 2010 For DevelopersSharePoint 2010 For Developers
SharePoint 2010 For Developers
 
Creating a data report in visual basic 6
Creating a data report in visual basic 6Creating a data report in visual basic 6
Creating a data report in visual basic 6
 
Wpf 1
Wpf 1Wpf 1
Wpf 1
 
Flex Framework Presentation PPT
Flex Framework Presentation PPTFlex Framework Presentation PPT
Flex Framework Presentation PPT
 
Vb basics
Vb basicsVb basics
Vb basics
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
 
Arthur Del Prado .Net Portfolio
Arthur Del Prado .Net PortfolioArthur Del Prado .Net Portfolio
Arthur Del Prado .Net Portfolio
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
 
Vb unit t 1.1
Vb unit t 1.1Vb unit t 1.1
Vb unit t 1.1
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Jeff Huber Portfoilio
Jeff Huber PortfoilioJeff Huber Portfoilio
Jeff Huber Portfoilio
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
 
Asp.net
Asp.netAsp.net
Asp.net
 
Delphi for PHP “In Action”
Delphi for PHP “In Action”Delphi for PHP “In Action”
Delphi for PHP “In Action”
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
 

Similar to C# p1

M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
Thomas Daly
 
Tutorial 1
Tutorial 1Tutorial 1
Tutorial 1
Aravindharamanan S
 
M365 global developer bootcamp 2019
M365 global developer bootcamp 2019M365 global developer bootcamp 2019
M365 global developer bootcamp 2019
Thomas Daly
 
M365 global developer bootcamp 2019 PA
M365 global developer bootcamp 2019  PAM365 global developer bootcamp 2019  PA
M365 global developer bootcamp 2019 PA
Thomas Daly
 
Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web techh
Web techhWeb techh
Web techh
SangeethaSasi1
 
Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Programming basics
Programming basicsProgramming basics
Programming basics
Senri DLN
 
vb.pptx
vb.pptxvb.pptx
vb.pptx
CherryLim21
 
vb-160518151614.pdf
vb-160518151614.pdfvb-160518151614.pdf
vb-160518151614.pdf
LimEchYrr
 
vb-160518151614.pptx
vb-160518151614.pptxvb-160518151614.pptx
vb-160518151614.pptx
LimEchYrr
 
Understanding IDEs
Understanding IDEsUnderstanding IDEs
Understanding IDEs
sunmitraeducation
 
Introduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET ControlsIntroduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET Controls
KhademulBasher
 
Visual basic
Visual basicVisual basic
Visual basic
umesh patil
 
How create react app help in creating a new react applications
How create react app help in creating a new react applications How create react app help in creating a new react applications
How create react app help in creating a new react applications
Concetto Labs
 
Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)Michael Dobe, Ph.D.
 
Part 3 web development
Part 3 web developmentPart 3 web development
Part 3 web developmenttechbed
 
Updated Resume
Updated ResumeUpdated Resume
Updated Resumechaunhi
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
EliasPetros
 

Similar to C# p1 (20)

M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
 
Tutorial 1
Tutorial 1Tutorial 1
Tutorial 1
 
M365 global developer bootcamp 2019
M365 global developer bootcamp 2019M365 global developer bootcamp 2019
M365 global developer bootcamp 2019
 
M365 global developer bootcamp 2019 PA
M365 global developer bootcamp 2019  PAM365 global developer bootcamp 2019  PA
M365 global developer bootcamp 2019 PA
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web techh
Web techhWeb techh
Web techh
 
Web tech
Web techWeb tech
Web tech
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
vb.pptx
vb.pptxvb.pptx
vb.pptx
 
vb-160518151614.pdf
vb-160518151614.pdfvb-160518151614.pdf
vb-160518151614.pdf
 
vb-160518151614.pptx
vb-160518151614.pptxvb-160518151614.pptx
vb-160518151614.pptx
 
Understanding IDEs
Understanding IDEsUnderstanding IDEs
Understanding IDEs
 
Introduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET ControlsIntroduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET Controls
 
Visual basic
Visual basicVisual basic
Visual basic
 
How create react app help in creating a new react applications
How create react app help in creating a new react applications How create react app help in creating a new react applications
How create react app help in creating a new react applications
 
Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)
 
Part 3 web development
Part 3 web developmentPart 3 web development
Part 3 web development
 
Updated Resume
Updated ResumeUpdated Resume
Updated Resume
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 

More from Renas Rekany

decision making
decision makingdecision making
decision making
Renas Rekany
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
Renas Rekany
 
AI heuristic search
AI heuristic searchAI heuristic search
AI heuristic search
Renas Rekany
 
AI local search
AI local searchAI local search
AI local search
Renas Rekany
 
AI simple search strategies
AI simple search strategiesAI simple search strategies
AI simple search strategies
Renas Rekany
 
C# p9
C# p9C# p9
C# p8
C# p8C# p8
C# p7
C# p7C# p7
C# p6
C# p6C# p6
C# p5
C# p5C# p5
C# p4
C# p4C# p4
C# p3
C# p3C# p3
C# p2
C# p2C# p2
Object oriented programming inheritance
Object oriented programming inheritanceObject oriented programming inheritance
Object oriented programming inheritance
Renas Rekany
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Renas Rekany
 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
Renas Rekany
 
Renas Rajab Asaad
Renas Rajab AsaadRenas Rajab Asaad
Renas Rajab Asaad
Renas Rekany
 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
Renas Rekany
 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
Renas Rekany
 
Kurdish computer skills lec1, Renas R. Rekany
Kurdish computer skills lec1, Renas R. RekanyKurdish computer skills lec1, Renas R. Rekany
Kurdish computer skills lec1, Renas R. Rekany
Renas Rekany
 

More from Renas Rekany (20)

decision making
decision makingdecision making
decision making
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
AI heuristic search
AI heuristic searchAI heuristic search
AI heuristic search
 
AI local search
AI local searchAI local search
AI local search
 
AI simple search strategies
AI simple search strategiesAI simple search strategies
AI simple search strategies
 
C# p9
C# p9C# p9
C# p9
 
C# p8
C# p8C# p8
C# p8
 
C# p7
C# p7C# p7
C# p7
 
C# p6
C# p6C# p6
C# p6
 
C# p5
C# p5C# p5
C# p5
 
C# p4
C# p4C# p4
C# p4
 
C# p3
C# p3C# p3
C# p3
 
C# p2
C# p2C# p2
C# p2
 
Object oriented programming inheritance
Object oriented programming inheritanceObject oriented programming inheritance
Object oriented programming inheritance
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
 
Renas Rajab Asaad
Renas Rajab AsaadRenas Rajab Asaad
Renas Rajab Asaad
 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
 
Kurdish computer skills lec1, Renas R. Rekany
Kurdish computer skills lec1, Renas R. RekanyKurdish computer skills lec1, Renas R. Rekany
Kurdish computer skills lec1, Renas R. Rekany
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

C# p1

  • 1. Renas R. Rekany Object-Oriented-Programming L1A 1 Object-Oriented-Programming Stage: Second Computer Science Department Computer & I.T Faculty Units 8 Hours Theoretical 2, Practical 2 Tutorial 2 OOP Lec: Renas R. Rekany 2015/2016
  • 2. Renas R. Rekany Object-Oriented-Programming L1A 2 History of programming languages 1- Microsoft .Net Framework .NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library known as Framework Class Library (FCL) and provides language interoperability(each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment (as contrasted to hardware environment), known as Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. FCL and CLR together constitute .NET Framework. FCL provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. Programmers produce software by combining their own source code with .NET Framework and other libraries. .NET Framework is intended to be used by most new applications created for the Windows platform. Microsoft also produces an integrated development environment largely for .NET software called Visual Studio. 2-Different DOTNET Types of Applications There are three main types of application that can be written in C#: 1. Winforms : Windows applications have the familiar graphical user interface of Windows with controls such as buttons and list boxes for input. 2. Console: Console applications use standard command-line input and output for input and output instead of a form. [[[[
  • 3. Renas R. Rekany Object-Oriented-Programming L1A 3 3. Web Sites. 3- Starting Visual Studio (2008/2015) -Double click on Microsoft Visual Studio (2008/2015) icon on desktop. OR -Open the Start menu, select All Programs, and then select Microsoft Visual Studio 2008/2015.
  • 4. Renas R. Rekany Object-Oriented-Programming L1A 4
  • 5. Renas R. Rekany Object-Oriented-Programming L1A 5 4- Create First Winforms application Step 1: Start Visual Studio Open the Microsoft Visual Studio 2008/2015. Step 2: Create a new project Go to File -> New Project, And then New Project Dialog Appears. In the New Project Window, Select Visual C# as Project type and Windows Forms Applications as the template. Give Name and Location to your project and finally click OK button to create our first C# project.
  • 6. Renas R. Rekany Object-Oriented-Programming L1A 6 Step 3: Design the user interface. When the project is created, you will see the designer view of your interface as follows. Form Designer View
  • 7. Renas R. Rekany Object-Oriented-Programming L1A 7 In this designer view of the form (Form1.cs [Design]), you can design the user interface of the single form. To do that, we use the 'Toolbox' which contains the items that you can add to your form. Toolbox is placed on the left side of your visual studio. If it is not visible go to View -> Toolbox to show the Toolbox. Toolbox It contains Labels, Buttons, Check Boxes, Combo Boxes and etc. This can be used to design your interface. To add elements from the Toolbox to your form double click the item or drag the item to your form. Now add a Button Control to your form by simple dragging a Button control into the form designer view. Finally it looks like below. Now our form contains two elements. Those are form and the button control. These elements have properties such as name, text, background color, fore color,
  • 8. Renas R. Rekany Object-Oriented-Programming L1A 8 etc.... To see properties for a control, select the control and all the properties are displayed in the Properties Window which appears on the right side of your visual studio. If it is not visible, Go to View -> Properties Window. Select the button and view properties as follows. Now set the text to 'Show' for the button.
  • 9. Renas R. Rekany Object-Oriented-Programming L1A 9 Step 4: Writing the code Double click on buttun1 to write the code private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Hello World!"); } Step 5: Compile the code To compile the code Go to Build -> Build HelloWorld Step 6: Running the application To run/execute the program press F5. Running Application.
  • 10. Renas R. Rekany Object-Oriented-Programming L1A 10 6- Create First Web application Building Your First Web Application Project Creating a New Project Select File->New Project within the Visual Studio 2005 IDE. This will bring up the New Project dialog. Click on the “Visual C#” node in the tree-view on the left hand side of the dialog box and choose the "ASP.NET Web Application" icon: Visual Studio will then create and open a new web project within the solution explorer. By default it will have a single page (Default.aspx), an AssemblyInfo.cs file, as well as a web.config file. All project file-meta-data is stored within a MSBuild based project file.
  • 11. Renas R. Rekany Object-Oriented-Programming L1A 11 Opening and Editing the Page Double click on the Default.aspx page in the solution explorer to open and edit the page. You can do this using either the HTML source editor or the design-view. Add a "Hello world" header to the page, along with a calendar server control and a label control (we'll use these in a later tutorial):
  • 12. Renas R. Rekany Object-Oriented-Programming L1A 12 Build and Run the Project Hit F5 to build and run the project in debug mode. By default, ASP.NET Web Application projects are configured to use the built-in VS web-server when run. The default project templates will run on a random port as a root site (for example: http://localhost:12345/):
  • 13. Renas R. Rekany Object-Oriented-Programming L1A 13 You can end the debug session by closing the browser window, or by choosing the Debug->Stop Debugging (Shift-F5) menu item. Customizing Project Properties ASP.NET Web Application Projects share the same configuration settings and behaviors as standard VS 2005 class library projects. You access these configuration settings by right-clicking on the project node within the Solution Explorer in VS 2005 and selecting the "Properties" context-menu item. This will then bring up the project properties configuration editor. You can use this to change the name of the generated assembly, the build compilation settings of the project, its references, its resource string values, code-signing settings, etc:
  • 14. Renas R. Rekany Object-Oriented-Programming L1A 14 ASP.NET Web Application Projects also add a new tab called "Web" to the project properties list. Developers use this tab to configure how a web project is run and debugged. By default, ASP.NET Web Application Projects are configured to launch and run using the built-in VS Web Server (aka Cassini) on a random HTTP port on the machine. This port number can be changed if this port is already in use, or if you want to specifically test and run using a different number:
  • 15. Renas R. Rekany Object-Oriented-Programming L1A 15 Alternatively, Visual Studio can connect and debug IIS when running the web application. To use IIS instead, select the "Use IIS Web Server" option and enter the url of the application to launch, connect-to, and use when F5 or Control-F5 is selected:
  • 16. Renas R. Rekany Object-Oriented-Programming L1A 16 Then configure the url to this application in the above property page for the web project. When you hit F5 in the project, Visual Studio will then launch a browser to that web application and automatically attach a debugger to the web-server process to enable you to debug it. Note that ASP.NET Web Application Projects can also create the IIS vroot and configure the application for you. To do this click the "Create Virtual Directory" button.