掌握Visual Basic .NET:迎接未来十年编程挑战

需积分: 9 4 下载量 32 浏览量 更新于2024-07-17 收藏 8.3MB PDF 举报
"《Sybex - Mastering Visual Basic .NET (VBL)》是一本深入介绍Visual Basic .NET编程语言的书籍,针对的是想要充分利用该语言的程序员,特别是那些希望在快速发展的IT领域保持竞争力的开发者。本书是在Visual Basic 1.0发布十周年之际推出的,旨在带领读者度过接下来十年的编程挑战。 .NET框架是.NET倡议的核心,它提供了一个庞大的函数库,几乎涵盖了所有编程任务,如绘制图形、创建文件夹、获取文件等。Visual Basic .NET作为一门易学且生产力高的语言,它的新版本通过访问.NET框架的对象,极大地扩展了功能,使其几乎可以完成其他语言所能实现的大部分任务,使语言变得非常强大,但也使得学习曲线变得更陡峭。 书中假设读者对基本的编程概念有所了解,包括变量、函数和条件语句的工作原理。作者选择深入探讨他认为大多数VB程序员会感兴趣的议题,例如应用程序开发原则和技术,而非浅尝辄止地介绍众多主题。章节中的代码示例着重于核心逻辑,而非完整的项目或控件详细描述,旨在帮助读者理解和掌握核心编程技巧。 书中不仅涵盖了基础的Windows应用程序开发,还提供了实用的、具有实际应用价值的例子,如文件和目录映射、表格打印和对象集合保存等。作者强调,编程不仅仅是遵循指令,更重要的是理解原理并能灵活运用到不同场景中。书中提供的详细步骤指导有助于完成特定任务,同时也会解释为什么要这样处理,并展示替代方法和前后知识的关联。 虽然书中不会深入讲解热门功能,如多线程编程,而是专注于扎实的编程技术和实践,帮助读者建立起坚实的基础。随着读者掌握了书中的内容,他们将能够应对未被讨论的先进主题。 为了充分利用电子书,读者需要安装Adobe Acrobat Reader带有搜索功能,通过搜索功能可以方便地查找书中内容。电子书提供了导航工具,包括搜索查询按钮和强大的搜索选项,以帮助用户找到所需信息。通过阅读这本书,读者不仅能提升自己的Visual Basic .NET技能,还能培养创造性解决问题的能力和对编程模型的理解。"
2019-08-15 上传
Bonus Reference VB.NET Functions and Statements This bonus reference describesthe functions and statements that are supported by Visual Basic .NET, grouped by category. When you’re searching for the statement to open a file, you probably want to locate all file I/O commands in one place. This is exactly how this reference is organized. Moreover, by grouping all related functions and statements in one place, I can present examples that combine more than one function or statement. The majority of the functions are the same as in VB6. One difference is that many of the VB6 statements are implemented as functions in VB.NET. Moreover, many VB6 functions have an equivalent method in a Framework class. VB programmers are so accustomed to the old func- tions that they will not consider the alternatives—at least for a while. The Len() function of VB6 returns the length of a string. In VB.NET you can retrieve the length of a string with the Length method of a string variable. If strVaris declared as string variable, you can retrieve its length by calling the Length method: Dim strVar As String = “a short string” Console.WriteLine(“The string contains “ & strVar.Length & “ characters”) Or you can call the Len() function passing the name of the string as argument: Dim strVar As String = “a short string” Console.WriteLine(“The string contains “ & Len(strVar) & “ characters”) Most of the built-in functions are VB6 functions, and they accept optional arguments. VB.NET uses overloaded forms of the same function, and this is an important difference you have to keep in mind as you work with the built-in functions. If you omit an optional argument, you must still insert the comma to indicate that an argument is missing. Optional arguments are enclosed in square brackets. The Mid() function, for example, extracts a number of characters from a string, and its syntax is newString = Mid(string[, start][, length]) The starting location of the characters to be extracted is specified by the startargument, and the number of characters to be extracted is length. If you omit the startargument, the extraction starts with the first character in the string. If you omit the lengthargument, all the characters from the specified position to the end of the string are extracted. The only mandatory argument is the first one, which is the string from which the characters will be extracted, and this argument can’t be omitted. The methods of the various classes are discussed in detail in the book. This bonus reference con- tains all the functions supported by VB.NET, and these functions are listed by category in Table 1. Items in the table that are not followed by parentheses are statements and are also described in this reference.
2019-08-15 上传
Introduction At first, .NET was no more than a distant echo in my consciousness. For a long time—it seems like years, and actually, it was years—I heard the distant beating of publicity drums regarding .NET, and I couldn't care less. My concern has always been to work with high- quality programming tools that are solid, rather than playing with the latest technology toy, and I am ever suspicious of publicity campaigns. Visual Basic 6 worked well enough for me, my consulting clients, and the readers of my books. Why should I bother taking the time to understand this .NET thing until it was tried-and-true technology? What's the .NET Strategy? Before we get to my "Aha!" moment—and I've had several epiphanies related to .NET and Visual Basic .NET—I would like to step back for a second and consider exactly what .NET is and what it is not. This is particularly confusing because some things that Microsoft calls .NET are a matter of "vision," some are marketing terms, and others—such as Visual Basic .NET—are grounded technologies that are here today. (I mean, what could be more grounded as a technology than a programming language?) Pushing aside the clouds of confusion that swirl around the terminology, Microsoft's .NET strategy involves three related offerings: • .NET Framework and Visual Studio .NET, a runtime platform and development environment that works with languages including Visual Basic .NET • .NET Enterprise Servers, a set of enterprise server products such as Biztalk Server, Exchange Server, Mobile Information Server, and SQL Server, which happen to have been given the .NET moniker for marketing purposes • .NET MyServices, also sometimes called Hailstorm, which is a vision for creating services, such as the Passport user authentication service, that can be drawn upon as utilities by myriad distributed applications The domain of this book is the first of these: applications written in the Visual Basic .NET language, using the Visual Studio development environment, targeting the .NET Framework as a runtime platform. You can think of the runtime platform that .NET applications are written for as being analogous to the Java runtime "sandbox" that Java applications target, except that, at this point, the .NET Framework is primarily deployed on Microsoft Windows platforms.