VB .NET is only one component of a revolution in
Windows-the .NET framework. This framework provides the new support for
software development and operating system support in Windows, and it's more
extensive than anything we've seen in Windows before. The .NET framework wraps
the operating system with its own code, and your VB .NET programs actually
deal with .NET code instead of dealing with the operating system itself. And
it is specially designed to make working with the Internet easy.
At the base of the .NET framework is the Common Language
Runtime (CLR). The CLR is the module that actually runs your VB .NET
applications. When you create a VB .NET application, what really happens is
that your code is compiled into the CLR's Intermediate
Language (named MSIL, or IL for short), much like bytecodes in Java. When
you run the application, that IL code is translated into the binary code your
computer can understand by some special compilers
built into the CLR. Compilers translate your code into something that your
machine's hardware, or other software, can deal with directly. In this way,
Microsoft can one day create a CLR for operating systems other than Windows,
and your VB .NET applications, compiled into IL, will run on them.
The .NET Framework class library is the second major part of
the .NET framework. The class library holds an immense amount of prewritten
code that all the applications you create with Visual Basic, Visual C++, C#,
and other Visual Studio languages build on. The class library gives your
program the support it needs-for example, your program may create several
forms, and as there is a class for forms in the class library, your program
doesn't have to perform all the details of creating those forms from scratch.
All your code has to do is declare a new form, and the CLR compilers can get
the actual code that supports forms from the .NET Framework class library. In
this way, your programs can be very small compared to earlier Windows
applications; because you can rely on the millions of lines of code already
written in the class library, not everything has to be in your application's
executable (EXE) file.
All this assumes that you're working on a machine that has the
.NET framework, and therefore the CLR and the .NET Framework class library,
installed. The code for all elements we use in a VB .NET application-forms,
buttons, menus, and all the rest-all comes from the class library. And other
Visual Studio applications use the same class library, making it easy to mix
languages in your programming, even in the same application. Also,
distributing applications is easier, because all the support you need is
already on the machine you're installing your application to.
As mentioned, the .NET framework organizes its classes into
namespaces. For example, the .NET framework includes the namespaces Microsoft.VisualBasic,
and Microsoft.Win32. In fact, these namespaces contain
relatively few classes; the real way we'll interact with the .NET framework
class library in this book is through the System
The System Namespaces
You can't build a VB .NET application without using
classes from the .NET System namespace, as we'll see
over and over again in this book. When you want to use a Windows form, for
example, you must use the System.Windows.Forms. Form
class. A button in a Windows form comes from the System.Windows.
Forms.Button class, and so on. There are many such
classes, organized into various namespaces like System.Windows.Forms.
Here's an overview of some of those namespaces:
essential classes and base classes that define commonlyused data types,
events and event handlers, interfaces, attributes, exceptions, and so
interfaces and classes that define various collections of objects,
including such collections as lists, queues, arrays, hash tables, and
classes that make up ADO.NET. ADO.NET lets you build data-handling
components that manage data from multiple distributed data sources.
classes that support the OLE DB .NET data provider.
classes that support the SQL Server .NET data provider.
classes that allow you to debug your application and to step through
your code. Also includes code to start system processes, read and write
to event logs, and monitor system performance.
access to the GDI+ graphics packages that give you access to drawing
classes that support advanced two-dimensional and vector graphics.
classes that support advanced GDI+ imaging.
classes that allow you to customize and perform printing.
classes that support advanced GDI+ typography operations. The classes in
this namespace allow users to create and use collections of fonts.
classes that specify culture-related information, including the
language, the country/region, calendars, the format patterns for dates,
currency and numbers, the sort order for strings, and so on.
types that support synchronous and asynchronous reading from and writing
to both data streams and files.
an interface to many of the protocols used on the Internet.
classes that support the Windows Sockets interface. If you've worked
with the Winsock API, you should be able to develop applications using
the Socket class.
classes and interfaces that return information about types, methods, and
fields, and also have the ability to dynamically create and invoke
classes that support the structure of the common language runtime
classes and interfaces that enable multithreaded programming.
classes and interfaces that support browser/server communication.
Included in this namespace are the HTTPRequest class
that provides information about HTTP requests, the HTTPResponse
class that manages HTTP output to the client, and the HTTPServerUtility
class that provides access to server-side utilities and processes. You
classes that are used to implement ASP.NET security in Web server
classes that let you build and use Web services, programmable entities
on Web Server that code can communicate with using standard Internet
classes for creating Windows-based forms that make use of the user
interface controls and other features available in the Windows operating
classes that support processing of XML.
These, along with the many other System
classes, form the foundation on which VB .NET applications rest. It's time
now to start taking a look at how to build those applications.