You are on page 1of 29

Unit -1

Introduction to .NET Framework


The .NET Framework is a software development platform that was introduced by Microsoft in
the late 1990 under the NGWS. On 13 February 2002, Microsoft launched the first version of the
.NET Framework, referred to as the .NET Framework 1.0.

The .NET Framework is a software development framework developed by Microsoft that


provides a runtime environment and a set of libraries and tools for building and running
applications on Windows operating systems. The framework includes a variety of
programming languages, such as C#, F#, and Visual Basic, and supports a range of
application types, including desktop, web, mobile, and gaming applications.
Components of .NET Framework

There are following components of .NET Framework:

1. CLR (Common Language Runtime)


2. CTS (Common Type System)
3. BCL (Base Class Library)
4. CLS (Common Language Specification)
5. FCL (Framework Class Library)
6. .NET Assemblies
7. XML Web Services
8. Window Services
The Common Type System

The common type system is the formal definition of how all types in the .NET Framework are
constructed, declared, used, and managed. The Common Type System (CTS) defines the
rules about data types and ensures that code is executed in a safe environment The
CTS specifies how type’s classes are referenced, and how applications and class libraries are packaged
for execution on the CLR. It defines class declaration, inheritance, referencing, and type management as
.NET Framework. Each language's designers have the freedom to interpret the CTS requirements and be
flexible in their usage. The common type system provides the following basics for the .NET Framework:

 CTS provide a first-class, pure object-oriented model supported by all programming languages that
have adopted the .NET Framework. In this regard it is responsible for the common language
specification and its implementation by .NET adherents.

CTS establishes the foundations and reference framework for cross language integration,

Interoperation, type safety, security, and high-performance code execution.

CTS defines rules that languages must follow, which helps ensure that objects written in different
languages can interact with each other.


Fig. : The CTS type model, which is the basis for object model and hierarchy

The Common Language Specification

Opinions about the Common Language Specification (CLS) vary. One that is accurate, but not intended
to be complimentary, calls .NET "many languages for one platform" (while Java is "one language for
many platforms"). For now it may be true that Windows is the only operating system, but for the
programmers of the many languages that support .NET, the CLS is a major breakthrough.

By writing "CLS-compliant code," you construct classes and components that can be used by any
language and its respective IDEs and development tools, without the need for complex COM and ActiveX
interfaces and registration details. To achieve the magic, the CLS requires that class and component
providers expose to consumers only the features that are common to all the .NET languages.

The CLS is really a subset of the common type system, as mentioned earlier. All the rules specified by the
common type system in the runtime environment, such as type safety, determine how the CLS governs
compliance at the code-construction and compilation levels. The CTS protects the integrity of code by
ensuring type safety; code constructs that risk type safety are excluded from the CLS. As long as you
produce CLS-compliant code, it will be verified by the CTS.

Benefits

Classes produced in one language can be inherited by ones used in other languages. Objects
instantiated from the classes of a sender written in one language can be passed to the methods of
receiver objects whose classes were created in other languages. The receiving objects accept your

you can debug across languages and even across processes. Exceptions can be raised in an object from
one language and understood by an object created in another language.

The Common Language Runtime

Your Visual Basic .NET applications, class libraries, and components live in two realities. The design time
reality is where you write source code, create classes and objects, design applications, debug, and
compile your code. The runtime reality is an external environment and for .NET managed code
applications, this environment is the common language runtime, better known as the CLR (not
commonly referred to as just the Runtime environment by the .NET architects).
Code that targets the CLR is called managed code, indicating that its execution in the runtime
environment is managed by the CLR. The CLR is a hosted-execution environment before it can be
bootstrapped on a target platform; the CLR's host must be supported on that platform. Microsoft has
already released several hosts, including Windows 2000, Windows XP, A subset of the CLR, called the
Common Language Infrastructure (CLI), has already entered the international standardization Process.

Figure: The CLR and its relationship to other runtime environments

The CLR is like a proxy service that sits between your application and the operating system. The
illustration shows the CLR sitting atop its host, a thin layer of binary support, and interacting with the
operating system.

The CLR is described as the "execution engine" of .NET. It provides the environment within
which the programs run. It's this CLR that manages the execution of programs and provides
core services, such as code compilation, memory allocation, thread management, and
garbage collection. Through the Common Type System (CTS), it enforces strict type safety, and
it ensures that the code is executed in a safe environment by enforcing code access security. The
software version of .NET is actually the CLR version.

Working of the CLR

When the .NET program is compiled, the output of the compiler is not an executable file but a
file that contains a special type of code called the Microsoft Intermediate Language (MSIL),
which is a low-level set of instructions understood by the common language run time. This MSIL
defines a set of portable instructions that are independent of any specific CPU. It's the job of the
CLR to translate this Intermediate code into a executable code when the program is executed
making the program to run in any environment for which the CLR is implemented. And that's
how the .NET Framework achieves Portability. This MSIL is turned into executable code using a
JIT (Just In Time) complier. The process goes like this, when .NET programs are executed, the
CLR activates the JIT complier. The JIT complier converts MSIL into native code on a demand
basis as each part of the program is needed. Thus the program executes as a native code even
though it is compiled into MSIL making the program to run as fast as it would if it is compiled to
native code but achieves the portability benefits of MSIL.
BCL (Base Class Library)

The base class library has a rich collection of libraries features and functions that help to
implement many programming languages in the .NET Framework, such as C #, F #, Visual C ++,
and more. Furthermore, BCL divides into two parts:

1. User defined class library


o Assemblies - It is the collection of small parts of deployment an application's
part. It contains either the DLL (Dynamic Link Library) or exe (Executable) file.
1. In LL, it uses code reusability, whereas in exe it contains only output file/
or application.
2. DLL file can't be open, whereas exe file can be open.
3. DLL file can't be run individually, whereas in exe, it can run individually.
4. In DLL file, there is no main method, whereas exe file has main method.
2. Predefined class library
o Namespace - It is the collection of predefined class and method that present in
.Net. In other languages such as, C we used header files, in java we used package
similarly we used "using system" in .NET, where using is a keyword and system is
a namespace.

Microsoft .NET Assemblies

A .NET assembly is the main building block of the .NET Framework. It is a small unit of code that
contains a logical compiled code in the Common Language infrastructure (CLI), which is used for
deployment, security and versioning. It defines in two parts (process) DLL and library (exe)
assemblies. When the .NET program is compiled, it generates a metadata with Microsoft
Intermediate Language, which is stored in a file called Assembly.

FCL (Framework Class Library)

It provides the various system functionality in the .NET Framework, that includes classes,
interfaces and data types, etc. to create multiple functions and different types of application
such as desktop, web, mobile application, etc. In other words, it can be defined as, it provides a
base on which various applications, controls and components are built in .NET Framework.

History of .NET Framework and its compatibility with the different Windows
version
CLR
Development tool
.NET Version Version Windows Support

1.0 1.0 Visual Studio .NET XP SP1

1.1 1.1 Visual Studio .NET 2003 XP SP2, SP3

2.0 2.0 Visual Studio 2005 N/A

3.0 2.0 Expression Blend Vista

3.5 2.0 Visual Studio 2008 7, 8, 8.1, 10

4.0 4 Visual Studio 2010 N/A

4.5 4 Visual Studio 2012 8

4.5.1 4 Visual Studio 2013 8.1

4.5.2 4 N/A N/A

4.6 4 Visual Studio 2015 10 v1507

4.6.1 4 Visual Studio 2015 Update 1 10 v1511

4.6.2 4 N/A 10 v1607

4.7 4 Visual Studio 2017 10 v1703

4.7.1 4 Visual Studio 2017 10 v1709

4.7.2 4 Visual Studio 2017 10v 1803

4.8 4 Visual Studio 2019 11

4.8.1 4 Visual Studio 2019 11


CLR
Development tool
.NET Version Version Windows Support

6 Visual Studio 2022 11

Code Manager
Code manager invokes class loader for execution.

Will try to explain the processing in terms of C# code which is written using .NET
Framework.
Step 1- Application code is written using a .NET - compatible language C#.

Step 2 - Code is compiled into MSIL, which is stored in an assembly (see Figure 1 - 2).

Step 3 - When this code is executed (either in its own right if it is an executable or when it is
used from other code), it must first be compiled into native code using a JIT compiler.

Step 4 - The native code is executed in the context of the managed CLR, along with any other
running applications or processes.
.NET supports two kind of coding

1. Managed Code
2. Unmanaged Code
Managed Code

The resource, which is with in your application domain is, managed code. The resources that
are within domain are faster.

The code, which is developed in .NET framework, is known as managed code. This code is
directly executed by CLR with help of managed code execution. Any language that is written in
.NET Framework is managed code.

Managed code uses CLR which in turns looks after your applications by managing memory,
handling security, allowing cross - language debugging, and so on.
Unmanaged Code

The code, which is developed outside .NET, Framework is known as unmanaged code.

Applications that do not run under the control of the CLR are said to be unmanaged, and certain
languages such as C++ can be used to write such applications, which, for example, access low
- level functions of the operating system. Background compatibility with code of VB, ASP and
COM are examples of unmanaged code.

Unmanaged code can be unmanaged source code and unmanaged compile code.

Unmanaged code is executed with help of wrapper classes.

Wrapper classes are of two types: CCW (COM callable wrapper) and RCW (Runtime Callable
Wrapper).

Wrapper is used to cover difference with the help of CCW and RCW.

COM callable wrapper unmanaged code


Runtime Callable Wrapper unmanaged code

Native Code

The code to be executed must be converted into a language that the target operating system
understands, known as native code. This conversion is called compiling code, an act that is
performed by a compiler.

Under the .NET Framework, however, this is a two - stage process. With help of MSIL and JIT.
MSIL (Microsoft Intermediate Language)
It is language independent code. When you compile code that uses the .NET Framework library,
you don't immediately create operating system - specific native code.

Instead, you compile your code into Microsoft Intermediate Language (MSIL) code. The MSIL
code is not specific to any operating system or to any language.

JIT (Just-in-Time)
Just - in - Time (JIT) compiler, which compiles MSIL into native code that is specific to the OS
and machine architecture being targeted. Only at this point can the OS execute the application.
The just - in - time part of the name reflects the fact that MSIL code is only compiled as, and
when, it is needed.

In the past, it was often necessary to compile your code into several applications, each of which
targeted a specific operating system and CPU architecture. Often, this was a form of
optimization.

This is now unnecessary, because JIT compilers (as their name suggests) use MSIL code,
which is independent of the machine, operating system, and CPU. Several JIT compilers exist,
each targeting a different architecture, and the appropriate one will be used to create the native
code required.

The beauty of all this is that it requires a lot less work on your part - in fact, you can forget about
system - dependent details and concentrate on the more interesting functionality of your code.

JIT are of three types:


1. Pre JIT
2. Econo JIT
3. Normal JIT
Pre JIT
It converts all the code in executable code and it is slow
Econo JIT
It will convert the called executable code only. But it will convert code every time when a
code is called again.
Normal JIT
It will only convert the called code and will store in cache so that it will not require
converting code again. Normal JIT is fast.
What is a .Net Assembly?
The .NET assembly is the standard for components developed with the Microsoft.NET.
Dot NET assemblies may or may not be executable, i.e., they might exist as the executable
(.exe) file or dynamic link library (DLL) file. All the .NET assemblies contain the definition of
types, versioning information for the type, meta-data, and manifest. The designers of .NET have
worked a lot on the component (assembly) resolution.

An assembly can be a single file or it may consist of the multiple files. In the case of multi-file,
there is one master module containing the manifest while other assemblies exist as non-
manifest modules. A module in .NET is a subpart of a multi-file .NET assembly. Assembly is one
of the most interesting and extremely useful areas of .NET architecture along with reflections
and attributes.

.NET supports three kinds of assemblies:

1. private
2. shared
3. satellite
1 Private Assembly

Private assembly requires us to copy separately in all application folders where we


want to use that assembly’s functionalities; without copying, we cannot access the private
assembly features and power. Private assembly means every time we have one, we
exclusively copy into the BIN folder of each application folder.

2 Public Assembly

Public assembly is not required to copy separately into all application folders. Public
assembly is also called Shared Assembly. Only one copy is required in system level, there
is no need to copy the assembly into the application folder.

Public assembly should install in GAC.

3 Shared assemblies (also called strong named assemblies) are copied to a single
location (usually the Global assembly cache). For all calling assemblies within the same
application, the same copy of the shared assembly is used from its original location.
Hence, shared assemblies are not copied in the private folders of each calling assembly.
Each shared assembly has a four-part name including its face name, version, public key
token, and culture information. The public key token and version information makes it
almost impossible for two different assemblies with the same name or for two similar
assemblies with a different version to mix with each other.

Metadata in .NET
Metadata is information about the assemblies, modules, and types that constitute .NET
programs.
In .NET, metadata is a common mechanism that the .NET runtime, compilers, and tools all can
use. Microsoft .NET uses metadata to describe all types that are used and exposed by the
particular .NET assembly.
In this sense, metadata describes an assembly in detail, including descriptions of its identity, the
types that it references, the type that it exports, and the security requirements for execution.
Much richer than a type library, metadata includes descriptions of an assembly and modules,
classes, interfaces, methods, properties, fields, events, global methods, and so forth.
Metadata provides enough information for any runtime, tool, or program to find out literally
everything that is needed for component integration.
Garbage Collection (GC)
Garbage Collection in .Net framework
The garbage collection (GC) is new feature in Microsoft .net framework. When we have a class
that represents an object in the runtime that allocates a memory space in the heap memory. All
the behavior of that objects can be done in the allotted memory in the heap. Once the activities
related to that object is get finished then it will be there as unused space in the memory.

The earlier releases of Microsoft products have used a method like once the process of that
object get finished then it will be cleared from the memory. For instance Visual Basic, An object
get finishes that work then there we have to define a "nothing" to that object. So, it clears the
memory space to the processors.

Microsoft was planning to introduce a method that should automate the cleaning of unused
memory space in the heap after the life time of that object. Eventually they have introduced a
new technique "Garbage collection". It is very important part in the .Net framework. Now it
handles this object clear in the memory implicitly. It overcomes the existing explicit unused
memory space clearance.

Garbage Collection
The heap memory is divided into number of generations. Normally it is three generations. The
Generation 0 is for short live objects, Generation 1 is for medium live objects which are moved
from Generation 0. Generation 3 is mostly stable objects.

When an object is created then it will allocate the memory space which will be higher. It will be
in the Generation 0 and the memory allocation will be continuous without any space between
the generations of garbage collectors.
Namespaces

Namespaces are the way to organize .NET Framework Class Library into a logical
grouping according to their functionality, usability as well as category they should belong to, or
we can say Namespaces are logical grouping of types for the purpose of identification.

The .NET Framework Class Library (FCL ) is a large collection of thousands of Classes.
These Classes are organized in a hierarchical tree. The System Namespaces is the root for types
in the .NET Framework. We can uniquely identify any Class in the .NET Framework Class Library
(FCL ) by using the full Namespaces of the class .In .Net languages every program is created with
a default Namespaces . Programmers can also create their own Namespaces in .Net languages.

Namespaces organize the objects defined in an assembly. Assemblies can contain


multiple namespaces, which can in turn contain other namespaces. Namespaces prevent
ambiguity and simplify references when using large groups of objects such as class libraries.

For example, the .NET Framework defines the ListBox class in


the System.Windows.Forms namespace. The following code fragment shows how to declare a
variable using the fully qualified name for this class:

Dim LBox As System.Windows.Forms.ListBox

Various types of application that we can develop on .NET.


•ASP.Net Web applications are programs that used to run inside some web server to fulfill
the user requests over the http. ASP.NET Web applications can range from simple Web sites
that consist of HTML pages to advanced enterprise applications that run on local and remote
networks. These enterprise applications also provide components for exchanging data using
XML. This type includes dynamic and data driven browser based applications. (Ex: Hotmail and
Google).

•Web services are “web callable” functionality available via industry standards like HTTP, XML
and SOAP.

•Windows applications are form based standard Windows desktop applications for common
day to day tasks. (Ex: Microsoft word). Run only under Windows environment. These
applications consume the services provided by the Windows operating system.

•Windows services are long-running executable applications that run on the system as a
background process. These applications do not interfere with the working of the other processes
that run on the same computer. Windows services execute within separate Windows sessions
created specifically for each Windows service. These services do not have a graphic user
interface and are ideal for running on the server. Windows services were earlier called NT
services.
•Console applications are light weight programs run inside the command prompt (DOS)
window. They are commonly used for test applications.

•Mobile applications can run on multiple mobile devices, such as Pocket PCs, mobile
phones, or personal digital assistants. These applications provide ubiquitous access to data
from mobile devices. The .NET Framework automatically makes changes to these applications
to enable them to run on multiple browsers, depending on the mobile device.

•Class libraries are components that you create once and reuse a number of times in multiple
applications. Class libraries allow you to define several classes, along with their methods and
interfaces, in one file. These libraries compile to .dll files and facilitate rapid development of new
applications because of reusability of code. To access the functionality of the classes in a class
library from your application, you need to include a reference to that library in your program.

Working with the VB.Net IDE


The visual basic IDE is a collection of menus, toolbars, and windows that come together to form
the GUI. There are several main windows that appear in the default Visual Basic IDE, along with the
various toolbars. The menus include standard windows means like a file menu and many menus that are
specific to VB.NET.

Set a screen resolution of about 1024x768 to get as much IDE real estate as you can without
reducing the icons and other elements beyond recognition. The following list provides the key IDE
resources you should first learn about to help you develop in a manner and style that is comfortable for
you.
Auto Hide Dockable Windows Explorer Menu Bar Server Explorer

Resource View Toolbox Macro Explorer Object Browser

Task List Command Window Output Window Find Results

Dynamic Help
Figure: An empty Visual Studio .NET IDE when started up

Auto Hide
This is a new feature in Visual Studio that instructs the IDE to "hide away" the windows you are not
currently using. Auto Hide is one of the most sophisticated features you could want in an IDE .Auto Hide
is not a permanent feature and if you want to keep a window exposed, simply toggle the feature off. To
toggle Auto Hide on or off,

Dockable or Floating Windows


You can dock all windows in Visual Studio to any edge of the main IDE window. The Auto Hide toggle
also serves to lock the window in place so you must first un−Auto Hide before you can move the
window. Undocking a window is as simple as yanking the window off the side of the IDE. You can also
double−click the title bar to dock or undock a window once Auto Hide is off.

Internet Explorer Menu Bar


As you've probably noticed, the IDE provides a full−featured version of Internet Explorer (modestly
named" Web Browser"). This browser is fully integrated with the main Internet facilities, so any folders
created or favorites added will show up in the main Explorer browser. Adding favorite URLs to the IDE,
as you do with your main Internet Explorer (or whatever Web browser you prefer to use), is a prime
feature. You will likely use this option a lot to store any help document, resource, or Navigating the
IDE

Server Explorer
The Server Explorer window lets you access server−side resources, such as databases, email servers,
event logs, and message queues. As you know, the entire .NET Framework extends to the so−called .NET
Servers so all related resources used in the development process are accessible from within the IDE. The
Server Explorer window is illustrated un−docked from the IDE.
Menu Bar
The menu bar list the menus that we can use in active window .the vb menu bar contains the
name of the menu which we can use in the active windows. The following menu are available in
menu bar

1. File: Contain Options for opening projects, closing projects, printing project etc.
2. Edit: Contain option such as cut copy paste etc.
3. View: contain options for displaying IDE Window & tool bars.
4. Project: Contains options for adding forms menu, classes to the project.
5. Format: contains option for aligning and locking a forms control
6. Debug: Contains options debugging
7. Run: contains options for manipulating data from a data base.
8. Windows: contains options for arranging and displaying windows.

The Toolbars
The toolbars allow us to quickly access to commonly used menu command besides the
main toolbars, which is displayed by default below the menu bar

Form Layout window


The form layout window allows us to visually position our forms at design time. The form layout
windows specify a form position on screen at run time. The form layout windows consist of an
image representing the screen and the form forms relative position on the screen .we can set
the position of form by dragging the form in screen.

Property Window
The properties windows displays the properties of form or controls properties are changeable
attributes of a control such as size, position, color etc.

Steps to set properties

1. In the properties windows select properties.


2. in the property setting box type or select the designer setting for the selected property.
Property is listed either in alphabetic order or categorically.
Form designer

When we start in project in vb, initially a black form is displayed on the screen. This is called
form designer in which we design our program by placing controls on form.
Code Designer:-

Code designer is used to edit the code for a component’s can use the tab at the top center of
the IDE to switch between code designer and form designers.

Form Layout window

The form layout window allows us to visually position our forms at design time. The form layout
windows specify a form position on screen at run time. The form layout windows consist of an
image representing the screen and the form forms relative position on the screen .we can set
the position of form by dragging the form in screen.

Toolbox
The Toolbox contains the components and controls that can be added to Windows Forms applications
and Web Forms applications. The components of the Toolbox become available to you only when you
have forms open, as illustrated. The Toolbox, the standard controls available to you and Windows Forms
more extensively. The Toolbox is divided into several sections as a tabbed layout that lets you navigate
quickly and intelligently among the different types of objects or controls you may wish to add to your
forms and classes.

The default Toolbox divisions are as follows:

Data Contains data controls such as DataSet and DataView.

Components Offers specialized components you can place on forms, such as timers, message

Queues and processes.


Windows Forms Composed of visual (and some non−visual) controls used with Windows Forms,
especially for building user interfaces.

Clipboard Ring provides a scratch pad for copying frequently needed code snippets.

Navigating the IDE

Object Browser
The Object Browser is one of the most important windows you will access during the lifetime of
a development project. It lets you look at all the classes provided by the .NET Framework as
well as any custom classes and types you are working on. It identifies the various namespaces
and the assemblies within which they are packaged.

Task List
Once you become productive, the Task List will be another essential tool. This utility helps you manage
tasks within the solution;

Command Window

The Command Window is another imperative feature of the new Visual Studio .NET IDE. The Command
Window has two views, Command and Immediate. Command Mode Lets you execute Visual Studio
Commands without using the IDE menu system.

(The illustration shows execution of the File. AddNewProject command, which is the command

Behind the File menu item New, Project.)


Output Window
The Output Window displays build/compiler or diagnostic information depending on the mode it is in.
During a build of a project or solution, the window is used to communicate build and compile
information. In Debug mode, during processing, the Output Window displays libraries loaded, return
codes, and various details being emitted from running code.

Dynamic Help and Search


Dynamic Help is one of the most useful features of this IDE Simply place your cursor on an
element of your code (such as a class name or a method) and Dynamic Help finds and displays a
link to the resource in the Visual Studio help system. Another important feature is the help
system's Search facility, which comes equipped with a Help Filter. It will save time and
resources, filtering your help material to just Visual Basic and related information.
Solution Directory Structure
Wherever you choose to place your projects, the solution creates a special collection of folders for the
various files that make up the application.

Lists the most important files and folders and describes their functions.

The Solution Folder Hierarchy for Each Project the Solution Contains

File Directory Description


Vb7cr.sln Your solution file, which contains details about the individual projects and

their locations in the solution. The file is text and can be manually edited so

you can point to new project file paths.

Vb7cr.vbproj Visual Basic project file. Contains information about all of the files connected

with a specific project within a solution. Not recommended to open manually

with Notepad.

Vb7cr.suo The solution user options file, which stores all your custom settings. It is
hidden in the root folder of your solution. Make sure you back it up because

the solution reads from this file whenever you open it. VS writes to the file as

you make changes.

*.vb This is the extension of source code units. The files hold source code for

classes, forms, and components. The data in a file is in plain text and can be

edited with any text editor.

*.resx Your assembly resource files (see Chapter 17) used for the definition of

application resources.

Bin directory The folder that builds are loaded from. During debug, builds VS will load files

from this folder and pull files over from the Obj folder as well. Written to

during builds.

Obj directory Used for the output of specific configurations and builds. Written to during

builds which store information is a special Program Debug Database (*.PDB).

File Extensions
You should be aware of various file extensions for Visual Basic .NET applications. For starters, there are
no more form (FRM) files that represented VB 6 forms. Now that forms in .NET are class files, the unit
containing your form source is given the .vb extension. Also, most files prefixed or suffixed with an "x"
harbor XML−compliant code.
describes each file extension.

Common File Extensions Used with the Visual Basic Projects

File Extension Description

.XML An XML Document

.XSD An XML Schema File without generated classes

.TDL Your Template Description Language File

.VB Standard source files for Windows forms, controls, classes, and miscellaneous
code

.RPT Your Crystal Reports Designer files


Creating a new project

When we start VB we will see a window we have to select the project type which we want to be open

Types of project
Before moving on, let me mention briefly all the types of projects you can build with Visual
Studio in additon to /Windows applications, All the project types supported by Visual Studio are
displayed on the New Project dailog box, and they're the following :

Class library :

A class library is a basic code-building component, which has no visible interface and adds
specific functionality to your project. Simply put, a class is a collection of functions that will be
used in other projects beyond the current one. With classes, however, you don't have to distribute
source code, Class libaries are equivalent to Active X DLL and Active X EXE project types of
VB6.

Windows control library:

A Windows control (or simply control), such as a TextBox or Button, is a basic element of the user
interface, If the controls that come with Visual Basic (the ones that appear in the Toolbox by default)
don't provide the functionality you need, you can build your own custom controls, People design their
own custom controls for very specific operations to simplify the development of large applications in a
team environment. If you have a good idea for a custom control, you can market it- the pages of the
computer trade magazines are full of ads for advanced custom controls that complement the existing
ones.

Console application:

A console application is an application with a very limited user interface. This type of
application displays its output on a Command Prompt window and receives input from the same
window, You'll see an example of a simple Console application later in this chapter, and that will
be the last Console application in this book. The purpose of this book is to show you how to
build Windows and Web applications with rich interfaces, not DOS-like applications. However,
the product's documentation uses Console applications to demonstrate specific topics, and this is
why I've included a short section on Console applications in this chapter.

Windows service:

A Windows service is a new name for the old NT services, and they're long running applications
that don't have a visible interface. These services can be started automatically to changes in the
file system is a prime candidate for implementing as a Windows service. When users upload files
to a specific folder, the Windows service might initiate some processing (copy the file, read its
contents and update a databae, and so on). We will not discuss Windows services in this book.

ASP.NET Web application: -

Web applications are among the most exciting new features of Visual Studio, A Web application
is an app. that resides on a Web server and services requests made through a browser. An online
bookstore, for example, is a Web application. The application that runs on the Web server must
accept requests made by a client (a remote computer with a browser) and return its responses to
the requests in the form of HTML pages. Web applications are not new, but ASP.NET hides
many of details of building Web applications and makes the process surprisingly similar to the
process of building Windows applications. Web applications and Web services are discussed in
detail in the last part of the book.

ASP.NET Web service: -


A Web service is not the equivalent of a Windows service. A web service is a program that
resides on a Web server and services requests, just like a Web application, but it doesn't return an
HTML page. Instead, it returns the result of a calculation or a database lookup. Requests to Web
services are usually made by another server, which is responsible for processing the data. A Web
application that accepts a query for all VB books published by Sybex will return a page with the
results. A Web service that accepts the same query will return an XML file with the results. The
file will be used by the application that made the request to prepare a new page and send it to the
client, or to populate a Windows form.

Web control library :-


Just as you can build custom Windows controls to use with your Windows forms, you can create
custom Web controls to use with your Web pages. Web controls are not discussed in this book,
but once you're understood how ASP applications work and how Web applications interact with
clients, you'll be able to follow the examples in the documentation.
There are four type of application in visual basic – those based on windows forms (such application are
usually local to your application), web application (that comes to you across the internet), console
application (that runs in dos in windows) and mobile application (that runs on mobile phone platform
like the pocket PC etc)

Creating a windows application


To create an application based on windows form, select the new item in the file menu then select the
project item in the sub menu that appears. This brings up a new project dialog box. Select the folder
labeled visual basic project in the project types box and select the windows based application project
type in template box .you also can name the new project
Creating a web application
To create an windows application in visual basic, you select the file name |new|project menu item
opening the new project dialog box as before; select the visual basic folder in the project type box select
ASP.NET web application the templates dialog box. And you can give a new application name,

Creating Console application


There is a new type visual basic application in VB.NET – Console application there application are
command line based and run in DOS Windows. To create a console application in visual basic, you
select the file name |new|project menu item opening the new project dialog box as before; select the
visual basic folder in the project type box select Console application in the templates dialog box.

You might also like