使用参数从javascript调用ClickOnce应用程序 [英] Call ClickOnce app from javascript with parameters

查看:121
本文介绍了使用参数从javascript调用ClickOnce应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从部署在其上的网络应用程序(使用IE)启动Windows窗体应用程序(使用ClickOnce部署并安装到用户PC上)我们的企业内联网网站。  我还需要将两个参数传递给Windows窗体应用程序,并且需要通过Web应用程序中的页面使用Javascript执行此
。  我能够成功拨打电话并启动没有参数的Windows应用程序,但是当我尝试使用参数时,我只是猜测语法并且不成功。  以下是我正在成功执行的
javascript调用并启动Windows应用程序:

I need to launch a Windows Forms app (deployed with ClickOnce and installed onto a users pc) from a web app (using IE) that is deployed on our Corporate Intranet site.  I also need to pass two parameters to the Windows Form app, and need to do this with Javascript from a page in the web app.  I am able to successfully make the call and launch the windows app without parameters, but when I attempt to do so with parameters, I am merely guessing at the syntax and am unsuccessful.  Here is the javascript call I am making that executes successfully and launches the windows app:

var WshShell = new ActiveXObject(" WScript.Shell");

var WshShell = new ActiveXObject("WScript.Shell");

WshShell.Run(" rundll32.exe dfshim.dll,ShOpenVerbShortcut" + pathToWindowsFormsApp);

WshShell.Run("rundll32.exe dfshim.dll,ShOpenVerbShortcut " + pathToWindowsFormsApp );

这样运行正常但是有可能通过在此调用的参数,Windows窗体应用程序将使用?  若然,语法应该是什么?

This runs fine, however is it possible to pass in parameters with this call that the Windows Forms App will then use?  If so, what should the syntax be ?

谢谢!

推荐答案

您好,

>>但是,是否可以通过此窗体应用程序将使用的此调用传入参数?  如果是这样,语法应该是什么?

>> however is it possible to pass in parameters with this call that the Windows Forms App will then use?  If so, what should the syntax be ?

如果您的应用程序是使用HTTP启动的,那么您可以在查询字符串中传递信息。在您执行此操作之前,您需要选择"允许将网址参数传递给应用"

If your application is being launched using HTTP, you can pass information in a query string. Before you do this, you need selected "Allow URL parameters to be passed to application "

请参阅MSDN文章:如何:在线ClickOnce应用程序中检索查询字符串信息

Please refer to MSDN article: How to: Retrieve Query String Information in an Online ClickOnce Application

https://msdn.microsoft.com/en-us/library /ms172242.aspx

此外,请参阅RobinDotNet撰写的另一篇文章: 如何将参数传递给离线ClickOnce应用程序

In addition, please refer to another article write by RobinDotNet:  How to pass arguments to an offline ClickOnce application

https:// robindotnet .wordpress.com / 2010/03/21 / how-to-arguments-to-a-offline-clickonce-application /

希望这会对你有所帮助你好。

Hope this will be helpful to you.

最好的问候,

Bob


这篇关于使用参数从javascript调用ClickOnce应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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