Judgment on running and updating outside the Silverlight Browser

Source: Internet
Author: User

The original version of Silverlight is the same as that of flash and can only be run in the browser. The host is in the browser. After Silverlight 3, the function that can run without the browser is added, programs can be downloaded to the local offline for running, and the Silverlight program can be opened through shortcuts. This feature is very "cool" and is very novel and contemporary.

It is also very easy to run without a browser (this is also a common feature of Microsoft products. Many people also say that Microsoft's things are not flexible. In fact, this is a proof of technical strength, and the scalability is very good .)

Right-click the Silverlight project and choose Properties to open the Project Properties window. For example, select the check box in the red box,Note that the xap cache conflicts with the running outside the browser.

 

After the parameters are configured, The appmanifest. xml file in the project folder records the configuration S.

Use the code to prompt you to install the local application
Private void installapp () {Switch (application. Current. installstate) {Case installstate. Installed: MessageBox. Show (" |? Which of the following statements have been executed? 2 installation degree. Break "); break; Case installstate. installfailed: MessageBox. Show (" |? Cheng xuanyuan shao'an 2 installation ° loss § defeat U ,? Please? ? Try ?. Break "); break; Case installstate. Installing: MessageBox. Show (" |? Cheng xiangzheng Zheng y installs ° in úan 2, D... -"); Break; Case installstate. notinstalled: application. Current. Install (); // Install 2? Ben? Location? Break ;}}

 

 

Check for updates
Application APP = app. Current; Public SC _app_checkupdate () {initializecomponent (); addevent () ;}// '¨? Line? Application | use? In the descending order, what is new? Things? Piece t void addevent () {app. checkanddownloadupdatecompleted + = new checkanddownloadupdatecompletedeventhandler (current_checkanddownloadupdatecompleted); // start? Change U new? App. checkanddownloadupdateasync ();} // What is the new version? After I complete my tasks? File t void current_checkanddownloadupdatecompleted (Object sender, checkanddownloadupdatecompletedeventargs e) {If (E. updateavailable) {MessageBox. Show ("publish current? New? Version? Ben?? Silverlight application | use? Process sequence "+ ",? Please?? New? Qi? Use? You?? Application | use? Explain in the descending order !? ");} Else if (E. Error! = NULL & E. error is platformnotsupportedexception) {MessageBox. Show ("Publish failed? New? Version? Ben? Silverlight application | use? In descending order ,? "+"? Yes? No? Nengu Yun? Row D's in úur? Silverlight version? Ben? Medium D ,? Please? Access? Q: What is the new version of the master route page 3 in the descending order? ");} Else {MessageBox. Show (" no? D New? Version? Ben? Application | use? In the descending order of Cheng shujié, I want a to be updated ?!? ");}}

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.