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.
Ad

More Related Content

What's hot (20)

Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
Mohit Verma
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
Saikarthik103212
 
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 computer
simran153
 
Introduction to visual basic
Introduction to visual basicIntroduction to visual basic
Introduction to visual basic
Manav 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 6
mrgulshansharma
 
Wpf 1
Wpf 1Wpf 1
Wpf 1
Fajar Baskoro
 
Flex Framework Presentation PPT
Flex Framework Presentation PPTFlex Framework Presentation PPT
Flex Framework Presentation PPT
Constantin Stan
 
Vb basics
Vb basicsVb basics
Vb basics
sagaroceanic11
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
Tennyson
 
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
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
Faisal Aziz
 
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 computer
simran153
 
Introduction to visual basic
Introduction to visual basicIntroduction to visual basic
Introduction to visual basic
Manav 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 6
mrgulshansharma
 
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 Introduction
Tennyson
 
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
 
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
 

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
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 tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web techh
Web techhWeb techh
Web techh
SangeethaSasi1
 
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
paboyjonesh32
 
Programming basics
Programming basicsProgramming basics
Programming basics
Senri DLN
 
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
waisfarjam
 
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
samimylahji
 
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.
 
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
 
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
 
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
paboyjonesh32
 
Programming basics
Programming basicsProgramming basics
Programming basics
Senri DLN
 
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
waisfarjam
 
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
samimylahji
 
vb-160518151614.pdf
vb-160518151614.pdfvb-160518151614.pdf
vb-160518151614.pdf
LimEchYrr
 
vb-160518151614.pptx
vb-160518151614.pptxvb-160518151614.pptx
vb-160518151614.pptx
LimEchYrr
 
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
 
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.
 
Ad

More from Renas Rekany (20)

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# p9
Renas Rekany
 
C# p8
C# p8C# p8
C# p8
Renas Rekany
 
C# p7
C# p7C# p7
C# p7
Renas Rekany
 
C# p6
C# p6C# p6
C# p6
Renas Rekany
 
C# p5
C# p5C# p5
C# p5
Renas Rekany
 
C# p4
C# p4C# p4
C# p4
Renas Rekany
 
C# p3
C# p3C# p3
C# p3
Renas Rekany
 
C# p2
C# p2C# p2
C# p2
Renas Rekany
 
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
 
Ad

Recently uploaded (20)

How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 

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.