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;
}