Chapter 2
Chapter 2
Chapter 2
applications
Web applications (ASP.NET applications)
Web services
Windows services
Workflow-enabled applications using Windows
2.Hardware Requirements
o The first level of the representation is the operating
system the .NET layer is located between the system and
applications.
o The second level is the Common Language
Runtime(CLR), which provides the part of the .NET
Framework doing the most work.
o The next level is the Base Class Library (BCL), which
provides all .NET objects that can be used both in your
code and by Visual Basic when creating applications.
o The last level is represented by applications that rely on
the previous layers.
o .NET Framework provides enormous advantages to
software developers in comparison to the advantages
provided by other platforms.
o Microsoft has united various modern as well as existing
technologies of software development in .NET
Framework.
o These technologies are used by developers to develop
highly efficient applications for modern as well as future
business needs.
o .NET Framework Class Library
o Common Language Runtime
o Dynamic Language Runtimes (DLR)
o Application Domains
o Runtime Host
o Common Type System
o Cross-Language Interoperability
o .NET Framework Security
o Side-by-Side Execution
o The .NET Framework is shipped with compilers of all .NET
programming languages to develop programs.
o There are separate compilers for the Visual Basic, C#, and
Visual C++ programming languages in .NET Framework
o Each .NET compiler produces an intermediate code after
compiling the source code.
o The intermediate code is common for all languages and is
understandable only to .NET environment.
o This intermediate code is known as MSIL
Intermediate Language:-
o is also known as MSIL (Microsoft Intermediate Language)
(IL).
oIL is then converted to machine code at the point where the
languages.
oExtensible types provided by a class library.
oGarbage collection.
o Managed code:- is the code that is executed directly by
the CLR instead of the operating system.
o The code compiler first compiles the managed code to
intermediate language (IL) code, also called as MSIL code.
o This code doesn't depend on machine configurations and
can be executed on different machines.
• In the managed code, since the execution of the code is
governed by CLR, the runtime provides different services,
such as garbage collection, type checking, exception
handling, and security support.
o These services help provide uniformity in platform and
language-independent behavior of managed code
applications.
The execution process for managed code.
A piece of managed code is executed as follows:
o Choosing a language compiler
Assignment
Introduction to Microsoft
Visual Studio 2010
o Create a Visual Basic 2010 Windows-based application
o Manage the windows in the Integrated Development
Environment (IDE)
o Set the properties of an object
o Add a control to a form
o Enter code in the Code Editor window
o Save a solution
o Start and end an application
o Close and open an existing solution
o Find and correct a syntax error
Visual programming is the creation of a computer program
by utilizing pictorial elements. ex. VB.NET
Visual programming language (VPL) is any programming
language that lets users create programs by manipulating
program elements graphically rather than by specifying
them textually.
A VPL allows programming with visual expressions, spatial
arrangements of text and graphic symbols, used either as
elements of syntax or secondary notation.
o User friendly & interactive using integrated development
environment (“IDE“).
o Support rapid application development
o Allows rapid design and prototype of Windows
applications
o Provide an effective development communication tool
o Easy to develop graphical user interfaces
o Multiple vendor support
o Most visual basic .NET is an Event driven program that
communicates with the users through GUI.
o That means users employ the GUI objects to select options,
to enter data, and cause events to occur.
o Graphical User Interface - consists of graphical objects
such as icons that are used by the end user to interact with
the operating system.
o The most famous GUI program is the Microsoft Windows
desktop.
VB.NET
ois an event driven programming language that allows to
build application/program for windows operating system and
the web.
osince it is one of the modern programming language ,it is
browser.
– Has a Web user interface
– Runs on a server
3. Console application
oA program that run in a text environment such as
Additional ways
• Double click a tool in the toolbox.
o Events: user actions while program is running.
Examples: clicking, double-clicking, scrolling
o Event procedure: set of instructions to be processed
code.
o Ho to open the code Editors window
1.Right click the form, and then click view code on the
context menu.
Additional ways
1. Double the form or a control on the form.
Figure 2-8: Code Editor window
o Class statement: used to define a class
◦ Begins with Public Class <class name>
◦ Ends with End Class
o Class Name list box: lists the names of objects (controls)
included in the user interface.
o Method Name list box: lists the events to which the
selected object is capable of responding.
o When you select a control from the Class Name list box
and a method name, a code template for the event appears
in the Code Editor window.
Syntax: rules of the language.
o Keyword: a word with special meaning in a programming
language.
o Event code template has a procedure header and a
procedure footer.
o Event’s procedure header:
– Begins with keywords Private Sub
– Procedure name includes Object name and Event name.
– Handles clause indicates for which objects’ events this
code will execute.
o Sub procedure: block of code that performs a task.
Figure 2-9: Code template for the exitButton’s Click event procedure
o Me.Close()instruction: closes the current form at run
time.
◦ If the current form is the only form, the application is
terminated.
o Me keyword: refers to the current form.
o Method: predefined VB procedure that can be invoked
(called) when needed.
o Sequential processing: each line is executed in sequence.
◦ Also called a sequence structure.
Figure 2-10: Me.Close() instruction entered in the Click event
procedure
o An asterisk appears on the designer and Code
Editor tabs if a change was made since the last
time the solution was saved.
o How to save a solution
• click file on the menu bar and click save all.
• click the save all button on the standard toolbar.
o Starting and Ending an Application
• Startup form: the form to be displayed when the
application starts.
o How to start an application
1. save the solution. Click debug on the menu bar, and then
click start debugging.
2. Save the solution, then press the F5 key on your keyboard.
o When you start a VB application, the IDE creates an
executable file
o Executable file:
– Can be run outside of Visual Studio 2010
– Has a file extension of .exe
– Stored in the project’s bin\Debug folder
o How to end an application.
• Click an exit button in the interface.
• Click file on the application’s menu bar, and then click Exit.
• Click the close button on the applications title bar.
• Click the stop debugging button.
o Closing the Current Solution
• Closing a solution closes all projects and files in that
solution. You are prompted to save any files that have
unsaved changes.
o How to close a solution
1. click file on the menu bar
2. click close solution
o Only one solution can be open at any one time.
o If a solution is already open, opening a different one will
close the currently open solution.
o How to open an existing solution
• Click file on the menu bar, and then click open project to
open project dialog box.
o Bug: an error in a program’s code.
o Debugging: the process of locating and correcting bugs in a
program.
o Syntax error: occurs when you break one of the
programming language’s rules.
◦ Most syntax errors are caused by typing errors.
o Rest the mouse pointer on the mistyped instruction to see
details about the error.
Figure 2-11: Syntax error in the exitButton’s Click event
procedure
o Syntax errors should be corrected before starting an
application.
o If you start an application with a syntax error, a dialog box
appears.
– Click No to open the Error List window.
operation.
Properties of the ProgressBar Control
1. Font: Gets or sets the font of text in the ProgressBar.