0% found this document useful (0 votes)
7 views

complete-reference-vb_net_10

Uploaded by

khalid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

complete-reference-vb_net_10

Uploaded by

khalid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Chapter 15: Data Processing and I/O

Overview
This chapter deals with Visual Basic .NET's and the .NET Framework's text, character, and binary data
processing abilities, as well as the I/O support for streams. We also introduce the regular expression classes
and file operations and get acquainted with the extensive support for XML. Data processing and I/O
represents the largest chapter in this book (and in most programming books) because it represents the most
common task any programmer will be required to perform, from simply reading a command−line argument to
loading a data warehouse with a hundred million bytes of information.

The discussion of files and streams also provides extensive examples of managing files and folders, streaming
data to and from objects (serialization), and more. Much of the code examples were extracted from a utility
called Indexworks, which tests classes I built to work against Microsoft Index Server. These include examples
that write noise words (words to strip out of search phrases that Web surfers submit) to a noise words file that
is loaded into an array or a linked list in the objects that send queries to Index Server.

The last section in this chapter "Serialization with XML" demonstrates providing XML serialization support
for the linked list and node objects we worked on in Chapter 13. It follows after a long discussion on file I/O
and demonstrates how to serialize the entire linked list and its node out to a file on the hard disk. It will show
how, when starting the application, the entire linked list object and its data nodes can be reconstituted back
into the application for immediate use.

Data Processing
Many languages are judged by their ability to manipulate and manage text and characters. Visual Basic .NET
is no exception. The reason is simple: Without this fundamental ability, we would be unable to process data
and represent it to our users, store it in databases, or print it to documents. There is hardly an application or
algorithm that does not require the facilities for some form of text or character manipulation. We write text to
the console, to dialog boxes, to event logs, and to the Debug Output window. We capture text from user input,
such as reading a character from the console. We break text apart, interpret it, clean it up, and send it back to
the screen, to databases, to files, to printers, to e−mail and pagers, and to remote devices.

In today's highly distributed world, text is king. The days of jumping through hoops and eating fire to get
binary objects from one point on a network to another have been put behind us with the advent of XML, a
sophisticated metadata framework for describing individual elements represented as text. Nowadays, all forms
of data, including data destined only for computer consumption, travels with the elements that describe it.
This so−called metadata, couched in XML tags, has turned text into the universal language of computing. As
long as a receiver can read the XML (using an XML parser or method that reads XML tags) and can support
what the text requires, it will know what to do with it.

In the not too distant past, sending a simple string from a VB application to a Java application or a Delphi
application (or vice versa) was akin to cracking a coconut with a crayon. Each language would encode and
encapsulate its text in a form that other applications could not easily translate. Strings wrapped in various
codes needed to be unwrapped or translateda process akin to the translation of English between a Mississippi
maiden out on a first date with a soccer freak from Liverpool. XML, the universal translator, changes all that.

The .NET Framework provides the power of text and character manipulation and processing in the form of
several classes that have an exceptional assortment of features for you to use. In particular, we will look at the

494

You might also like