Use ClickOnce to Deploy Windows Applications2006

Appendix. Creating a Windows Application for ClickOnce

To understand how ClickOnce works, this appendix covers how to create a Windows application using Visual Studio 2005. For this application, I will use the Visual Basic 2005 programming language. (My latest book from O'Reilly, Visual Basic 2005 Jumpstart, includes three hands-on projects that let you learn the new syntax quickly; check http://www.oreilly.com/catalog/vbjumpstart/index.html for more information.)

Launch Visual Studio 2005 and name the application MyApp. Populate the default Form1 with seven Button controls, as shown in Figure 1-20.

Figure 1-20. Populating the default Form1 with Button controls

The application will perform the following functions:

  • Let the user open a file and read its content.

  • Let the user select a file and save some content into the selected file.

  • Access an external web service (MSN Search).

  • Access a web service hosted on the same server that hosts the ClickOnce installation files.

  • Read the registry settings on the local computer.

  • Insert a record into a local database and then display the content of the database.

  • Display the content of a text file.

The following sections show the logic under each of the Button controls.

Категории