我们如何在ClickOnce应用程序中检索查询字符串信息? [英] How can we retrieve query string information in a ClickOnce Application?

查看:87
本文介绍了我们如何在ClickOnce应用程序中检索查询字符串信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个要使用ClickOnce部署的.NET Windows Forms应用程序。但是,我将需要该应用程序来检索传递给它的查询字符串参数。

I made a .NET Windows Forms application that I want to deploy using ClickOnce. However, I will need the application to retrieve the query string parameters passed to it.

我找到了此MSDN文章并按照其指示进行操作(选中标有允许将URL参数传递给应用程序),但似乎不起作用:

I found this MSDN article and followed its directions (select the check box labeled Allow URL parameters to be passed to application), but it doesn't appear to work:

如何:在ClickOnce应用程序中检索查询字符串信息

ApplicationDeployment.CurrentDeployment.ActivationUri在应用程序加载时为null。

ApplicationDeployment.CurrentDeployment.ActivationUri is null when the application loads.

例如:

http://example.com/Sample/Sample.application?a=1&b=2

http://example.com/Sample/Sample.application?a=1&b=2

注意:我并不是在询问传递查询字符串参数到setup.exe安装文件,以使应用程序在安装后首次运行。

Note: I'm not asking about passing the query string parameters to the setup.exe installation file for the application to work the first time when it is installed. Just the passing of query string to the application.

推荐答案

D’哦!除了从MageUI启用之外,我还需要从Visual Studio IDE启用相同的选项。我不知道怎么想。

D'oh! I needed to enable the same option from the Visual Studio IDE in addition to doing so from MageUI. I don't know how i missed it.

这篇关于我们如何在ClickOnce应用程序中检索查询字符串信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆