xxviii Introduction Why a Book This Large Granted, I could have written two or three books with the material you can find in these pages—for example, a book on VisualBasic .NET, another on Win32 applications and database applications, and a third on Web Forms, Web services, and other Internetrelated topics. I even suspect that smaller books might have been a wiser decision from a business perspective. Why didn’t I do that then? In my opinion, the revolutionary aspect of the .NET initiative is that it lets developers adopt a unified programming paradigm, regardless of the language they’re using or the type of application they’re building. All the objects in the .NET class library are closely interrelated, and you can’t create great applications by focusing on a small portion of the Framework and ignoring the rest. For example, programmers working on clientside solutions should learn about the Windows Forms portion of the Framework, but also about multithreading and GDI+. Programmers working on Web Forms should know about .NET data types, collections, and regular expressions. XML Web services programs require familiarity with object serialization and asynchronous delegates. Finally, you must master class inheritance, interfaces, assembly binding, and low-level details on memory management and garbage collection to write any type of .NET application. For all these reasons, I believe that a single volume can cover all the many facets of .NET programming better than many smaller books, which would inevitably overlap in their explanations of .NET fundamentals. And only a book from a single author can ensure that there are neither repetitions nor glaring omissions as it provides the big .NET picture. By the way, those of you who already own the first edition of ProgrammingMicrosoftVisualBasic .NET might notice that this edition has fewer pages than its predecessor, and then conclude that the new edition doesn’t cover topics in the same depth. That isn’t the case; the page count is different only because the publisher used a different layout style for the text. The word count command in Microsoft Word doesn’t lie: both editions contain about 3 million characters. To make room for new material in this edition, I moved some topics from the previous edition to separate files and made them available on the companion CD. You’ll find a mention of this extra material where appropriate. Check Out the E-Book, Too Many readers asked me why the first edition of ProgrammingMicrosoftVisualBasic .NET wasn’t provided in electronic format on the companion CD, unlike its ProgrammingMicrosoftVisualBasic 6 predecessor. I had to make this decision when I realized that the VisualBasic 6 e-book was freely available for download on several Web sites.
Introduction xxix Needless to say, this questionable practice had a huge cost in terms of lost sales. The only possible line of defense was to not offer ProgrammingMicrosoftVisualBasic .NET as an e-book. On the other hand, I realize that many readers would like to have an electronic and searchable version of the books they buy. This is especially true for large books like this one and for reference books that are meant to help developers in their everyday activity. For these reasons—but especially because I don’t want to hinder all readers because a small number of them behave unethically—I decided to include an e-book of this edition of ProgrammingMicrosoftVisualBasic .NETVersion2003 on the companion CD, cross my fingers, and hope for the best. I can’t protect the material on the CD from illegal copying, and I wouldn’t do it even if it were possible because I dislike treating readers as if they were potential misbehavers. I can only ask you to think twice before sharing the CD contents with other people and imagine how you would feel if you worked for months on an application only to see it freely downloadable from the Internet. Let me summarize what you’re going to find on the companion CD: ■ ProgrammingMicrosoftVisualBasic .NETVersion2003 (this book) in fully searchable e-book format. ■ ProgrammingMicrosoftVisualBasic 6 in fully searchable e-book format. ■ Additional documents about VisualBasic .NET and the .NET Framework (over 200 printed pages). ■ All the code samples, grouped by the chapter to which they refer. You can run code samples on any computer capable of running MicrosoftVisual Studio .NET2003. For serious development, you should have a system based on Pentium III or higher and running Windows 2000, Windows XP, or Windows Server 2003. (Windows NT is OK for Windows Forms projects, but not for developing ASP.NET applications.) Ensure that you have installed Internet Information Services (IIS) before installing Visual Studio .NET and the .NET Framework, if you want to develop ASP.NET solutions. You need about 2.5 gigabytes free on your disk to install Visual Studio .NET (about 500 megabytes of which must be available on the system drive) and 384 megabytes of RAM (even though at least 512 megabytes are necessary to work on real-world projects). Who Should Read This Book? Let me make another point clear up front. This book isn’t for beginner developers wishing to learn VisualBasic .NET. Rather, it’s for experienced VisualBasic developers who want to leverage the full potential of Microsoft .NET. If you don’t feel at ease with