Vous êtes sur la page 1sur 4

Introduction to Visual Basic

Overview of .NET
Microsoft .NET (pronounced dot net) is a software component that runs on the
Windows operating system. .NET provides tools and libraries that enable developers
to create Windows software much faster and easier. .NET benefits end-users by
providing applications of higher capability, quality and security. The .NET Framework
must be installed on a users PC to run .NET applications. All Microsoft technologies
depend on .NET Platform.
The .Net framework is a revolutionary platform that helps you to write the following
types of applications:
Windows applications

Web applications

Web services

Mobile Applications

Following are some of the components of the .Net framework:

Common Language Runtime (CLR)

The .Net Framework Class Library

Common Language Specification

Common Type System

Metadata and Assemblies

Windows Forms

ASP.Net and ASP.Net AJAX

ADO.Net

Windows Workflow Foundation (WF)

Windows Presentation Foundation

Windows Communication Foundation (WCF)

LINQ

Architecture of Code Compilation and Execution in .NET


As we know the programmer writes the source code which is, in this context, more
human understandable language. But computers dont understand this language,
they only understand just zeros and ones. We need to convert this source code into
machine code which is the only code that computers understand and thus execute.
In .NET, the code compilation for all the languages is similar. The language compiler
compiles the respective source code and generates Byte Code which is often called
MSIL Microsoft Intermediate Language. MSIL code in binary format is available in the
form of .exe and .dll file which is referred as PE file (Portable Executable).
The MSIL is then converted to Machine/Native Code by the CLR which is a
component inside the .NET.

Visual Studio
Microsoft Visual Studio is an integrated development environment (IDE) from
Microsoft. It is used to develop for all most all types of computer programs.
Visual Basic
VB.Net is a simple, modern, object-oriented computer programming language
developed by Microsoft to combine the power of .NET Framework and the common
language runtime with the productivity benefits that are the hallmark of Visual
Basic. In another way, Visual Basic .NET (VB.NET) is an object-oriented computer
programming language implemented on the .NET Framework. Although it is an
evolution of classic Visual Basic language, it is not backwards-compatible with VB6,
and any code written in the old version does not compile under VB.NET. Visual Basic
is just BASIC with Windows libraries instead of DOS libraries. It is still BASIC. It has
all the BASIC keywords. It has the BASIC syntax. It is the BASIC language, just with
Windows libraries.

Like all other .NET languages, VB.NET has complete support for object-oriented
concepts. Everything in VB.NET is an object, including all of the primitive types
(Short, Integer, Long, String, Boolean, etc.) and user-defined types, events, and
even assemblies. All objects inherits from the base class Object.

VB.NET is implemented by Microsoft's .NET framework. Therefore, it has full access


to all the libraries in the .Net Framework. It's also possible to run VB.NET programs
on Mono, the open-source alternative to .NET, not only under Windows, but even
Linux or Mac OSX.

The following reasons make VB.Net a widely used professional language:

Modern, general purpose.

Object oriented.

Component oriented.

Easy to learn.

Structured language.

It produces efficient programs.

It can be compiled on a variety of computer platforms.

Part of .Net Framework.

Hello World Application

The following code snippet is demonstrating the output statements for VB.NET in
console Application.

Imports System
Module Module1

Sub Main()
Console.WriteLine("Hello World") '' Output Statement

End Sub

End Module

The following code snippet is demonstrating the output statements for VB.NET in
console Application.

Imports System

Module Module1

Sub Main()

Console.WriteLine("Please Enter your Name:")


Dim name As String
name = Console.ReadLine() '' Input Statement
Console.WriteLine(name)

End Sub

End Module
The output statement can use Placeholders to print the output to console

Console.WriteLine("Your Name is: {0}", name)

Every Visual Basic application must contain a procedure called Main. This procedure
serves as the starting point and overall control for your application. The .NET
Framework calls your Main procedure when it has loaded your application and is
ready to pass control to it. Unless you are creating a Windows Forms application,
you must write the Main procedure for applications that run on their own.

Main contains the code that runs first. In Main, you can determine which form is to
be loaded first when the program starts, find out if a copy of your application is
already running on the system, establish a set of variables for your application, or
open a database that the application requires.

Vous aimerez peut-être aussi