Experience ClickOnce technology in Vs.net 2005

Source: Internet
Author: User

As programmers, we often have to face the development mode of choice, such as C/s mode and b/s mode. Now, many people seem to prefer to choose b/S mode for Web development, which is a lot of reasons. But one of the important reasons, that is because of B/s development, deployment is very easy, because it is easy to implement the "thin client", the client only need to use the browser to run the application. But the Web application developed in B/S mode, also has its shortcoming, mainly is because the function realizes, is not the method and the traditional C/S mode WinForm application compares, many WinForm under to realize the outstanding function, on the web all is very difficult to realize, or said some simply did not have the way to realize. But the traditional WinForm, also has its own difficulty in the deployment, if the client is many, each deployment and version upgrades are very troublesome.

In. NET 2.0, Microsoft has launched a new application deployment technology called ClickOnce (One-click), which solves this contradiction well. In Vs.net-Beat 2, ClickOnce technology has been integrated to make it easy for users to deploy WinForm-developed programs to easily manage their upgrade deployments. This article is a step-by-step introduction to using ClickOnce technology to deploy Windows applications in Vs.net 2005.

What does ClickOnce bring to us?

First, through the ClickOnce technology, we can implement the following deployment methods:

1 after the design of the WinForm program, you can choose to publish the program to the following storage location: File system, local Web server, FTP site, remote Web site.

2 when the application is deployed to the appropriate location, users can browse through a browser called Publish.htm file, click on the download link, the application download to the local installation. This publish.htm is an entry file for the deployment application and will continue to be discussed below.

3 After the user installs the program, will automatically generate shortcuts to the desktop, and in the control surface version of the increase in the deletion will find the program.

4 When the user starts the program, the system can first check whether the server has a new version of the program, if any, will automatically connect to the server, to see if there is a new version, if there is a new version, then automatically download the new version to the machine and install

Example of a simple ClickOnce program deployment

First, we open Visual Studio 2 and build a Windows application called Clickoncedemo in C #. Then drag and drop a button into the form, and write the following code in the Click event of the button:

private void btnClick_Click(object sender, EventArgs e)
{
  MessageBox.Show(System.Reflection.Assembly.GetExecutingAssembly ().Location);
}

When you run the above program, the system prints the location of the current application, as shown in the following illustration:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.