Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, you need to ensure that query string options are enabled (project properties=>publish=>options=>manifests=>allow url parameters...);</p> <p>Then - to allow parity between standalone and web, I use something like below (the important bit is <code>ActivationArguments.ActivationData</code>; you'll need a reference to <code>System.Deployment.dll</code> too).</p> <p>You could also look at <code>System.Deployment.Application.ApplicationDeployment.CurrentDeployment.ActivationUri</code>, which MSDN has a good example for <a href="http://msdn.microsoft.com/en-us/library/system.deployment.application.applicationdeployment.activationuri.aspx" rel="nofollow noreferrer">here</a>.</p> <hr> <pre><code> public static string[] GetStartupArguments() { List&lt;string&gt; allOptions = new List&lt;string&gt;(); try // command line { string[] options = System.Environment.GetCommandLineArgs(); if (options != null) { // strip the first (the exe name) int length = options.Length; for (int i = 1; i &lt; length; i++) allOptions.Add(options[i]); } } catch { } // lazy swallow try // query string { if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) { string[] options = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData; if (options != null &amp;&amp; options.Length &gt; 0) { foreach (string queryItem in new Uri(options[0]).Query.TrimStart('?').Split('&amp;')) { allOptions.Add(System.Web.HttpUtility.UrlDecode(queryItem)); } } } } catch { } // lazy swallow return allOptions.ToArray(); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload