Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ebook) Visual Studio .NET Mastering Visual Basic.pdf
Скачиваний:
136
Добавлен:
17.08.2013
Размер:
15.38 Mб
Скачать

78

Chapter 2 VISUAL BASIC PROJECTS

Figure 2.22

Use the Add/ Remove Programs utility to remove

or repair an application installed by the Windows installer.

As for the location of the executables and their support files, they’re in the EasyCalc Project folder under \Program Files\CompanyName folder. If the same customer installs another of your applications—say, the ProCalc Project—it will also be installed in its own folder under \Program Files\CompanyName. Just make sure all the Setup projects have the same value for the Manufacturer property, and the support files won’t be installed in multiple folders.

Summary

This chapter introduced you to the concept of solutions and projects. You learned how to build a simple solution with a single project, as well as a solution with multiple projects. Use solutions to combine multiple related projects into a single unit, so that your projects can share components. Each project in a solution maintains its individuality, and you can either edit one from within the solution or open it as a project and edit independently of the other projects in the solution.

You also learned how to develop Web applications. With VB.NET, developing Web applications is as easy as developing Windows applications. In a few short years, you should be able to design a single interface that can be used by both types of projects (even if this means that there will be nothing but Web applications). The user interface of Web and Windows applications may be different, but the code behind both types of projects is straight Visual Basic.

After you have developed an application, you will have to distribute it. Distributing Windows application isn’t a trivial process, but building a Setup program for your application with VB.NET is. All you have to do is add a Setup project to a solution that contains the project or projects that you want to distribute. The simplest type of Setup program doesn’t require any code, and you can create a Windows installer by just setting a few properties. The output of the Setup program is a file with the extension .msi, which you can copy to another computer. Once executed on the target computer, the MSI file will install the application, create a shortcut to the application in the user’s Programs menu, and even create an entry in Add/Remove Programs for repairing or uninstalling the application.

By now, you have a good idea about the environment and how Windows applications are built. In the following two chapters, you’ll read about the language itself.

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com

Chapter 3

Visual Basic: The Language

This chapter and the next discuss the fundamentals of any programming language: variables, flow-control statements, and procedures. A variable stores data, and a procedure is code that manipulates variables. To do any serious programming with Visual Basic, you must be familiar with these concepts. To write efficient applications, you need a basic understanding of some fundamental topics, such as the data types (the kind of data you can store in a variable), the scope and lifetime of variables, and how to write procedures and pass arguments to them.

As you have seen in the first two chapters, most of the code in a Visual Basic application deals with manipulating control properties and variables. This chapter explores in greater depth how variables store data and how programs process variables. If you’re familiar with Visual Basic, you might want to simply scan the following pages and make sure you’re acquainted with the topics and the sample code discussed in this chapter. I would, however, advise you to read this chapter even if you’re an experienced VB programmer.

VB6 VB.NET

Experienced Visual Basic programmers should pay attention to these special sidebars with the “VB6 to VB.NET” icon, which calls your attention to changes in the language. These sections usually describe new features in VB.NET or enhancements of VB6 features, but also VB6 features that are no longer supported by VB.NET.

If you’re new to Visual Basic, you may find that some material in this chapter less than exciting. It covers basic concepts and definitions—in general, tedious, but necessary, material. Think of this chapter as a prerequisite for the following ones. If you need information on core features of the language as you go through the examples in the rest of the book, you’ll probably find it here.

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com