Resolution: clickonce uses the URL to pass the XXX. application? A = 1

Source: Internet
Author: User

Enable URL parameters
In Solution Explorer, right-click your clickonce project, click Properties to go to the release tab, click "options", and select "Allow to application" in the displayed interface.ProgramPass URL parameters ".

Get Parameters
The next step is to obtain the parameter values in the URL. Because the clickonce application does not have httpcontext, you cannot use the request. querystring method to obtain the parameter.
However, parameters can be obtained from the publishing context. The following program returns a URL parameter set object of the namevaluecollection type.

CopyCodeThe Code is as follows: using system. Deployment. Application;
Using system. Web;
Using system. Collections. Specialized;
Private namevaluecollection getquerystringparameters ()
{
Namevaluecollection Col = new namevaluecollection ();
If (applicationdeployment. isnetworkdeployed)
{
String querystring = applicationdeployment. currentdeployment. activationuri. query;
Col = httputility. parsequerystring (querystring );
}
Return Col;
}

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.