ClickOnce 应用程序可以将值返回到加载它的页面吗?
我有一个从网页启动的在线 ClickOnce 应用程序。应用程序关闭后,我希望用户返回到该页面并获取从应用程序传递的一些结果。这可能吗?
现在我唯一的解决方案是应用程序将结果上传到我的服务器,并在启动网页上使用 javascript 在等待结果时每 15 秒轮询一次服务器。
I have an online ClickOnce application that launches from a web page. After the application is closed, I would like the user to return to that page with some results passed from the application. Is this possible?
Right now the only solution I have is for the application to upload the results to my server, and have javascript on the launching webpage to poll the server every 15 seconds as it waits for results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可以。无法将信息从 ClickOnce 安装的应用程序直接传递回客户端浏览器。
您的直觉是正确的,您应该让应用程序将结果上传到服务器(大概在 WCF 的帮助下)以进行后续处理并通过投票页面显示。
我还要补充一点,就您的 Web 应用程序链接到 ClickOnce 应用程序中的数据而言,您需要在 Web 应用程序和 ClickOnce 应用程序之间提供一个通用令牌。也许通过使用为客户端生成的通用 GUID 的自定义激活 URL 链接(例如 http://myserver.com/myapplication.application?id=18c40c3d-183c-4c22-8127-37cac3be6492)。
No. It is not possible to pass information directly back to the client browser from the ClickOnce installed application.
Your intuition is correct that you should have your application upload results to the server (presumably with the help of WCF) for subsequent processing and display via your polling page.
I'll also add, that in terms of your web application linking to data from the ClickOnce application you will need to come up with a common token between the web application and the ClickOnce application. Perhaps via a customised activation URL link that uses a common GUID generated for the client (e.g. http://myserver.com/myapplication.application?id=18c40c3d-183c-4c22-8127-37cac3be6492).