使用参数调用exe的HTML超链接 [英] HTML hyperlink to call exe with parameters

查看:174
本文介绍了使用参数调用exe的HTML超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- 寻找一些帮助。

-Hello, looking for some help.

我们目前有一个winform应用程序用于在我们公司做批准。该应用程序将html电子邮件发送给阅读电子邮件中的相关信息的审批者,并单击启动应用程序的超链接,以便他们可以批准。

We currently have a winform app used to do approvals in our company. The app sends html emails to the "approvers" who read the relevant info in the email and click on a hyperlink which launches the app so they can do their approval.

目前这是通过在电子邮件html中包含以下内容完成的:

Currently this is done by including the following in the email html:

; href = file:/// C:\Temp\test.exe>点击批准< / a>

正确启动应用程序,经过几个安全警告,我们可以。我们使用Outlook 2010。

This correctly launches the app, after a couple of security warnings which we are OK with. We use Outlook 2010.

现在,为了改进这个过程,我需要传递一个将该批准者标识到该应用的参数。如果我通过一个Windows快捷方式传递参数,那么这个方法可以正常工作,但是,我无法找到一种方式将参数传递给href属性中的exe,以便从电子邮件中执行。我看到无处不在,除了问题,什么都没找到。

Now, in order to improve this process I would need to pass an argument identifying the approver to the app. This works correctly if I pass the argument from, say, a windows shortcut, however, I cannot find a way to pass the argument to the exe in the href attribute in order to do it from the email. I looked everywhere, and found nothing except questions.

我尝试过以下操作无效:

I have tried the following to no avail:

< a href = file:/// C:\Temp\test.exe approverID>点击批准< / a>
< a href = file:// /C:\Temp\test.exe'approverID'>点击批准< / a>
< a href =file:// /C:\Temp\test.exe approverID>点击批准< / a>

我也试过这样做使用JavaScript,从HTML页面工作正常,但不是从Outlook中的电子邮件。

Also I have tried doing it with JavaScript, which from an HTML page works fine, but not from an email in Outlook.

我认为也许这种方法存在安全威胁,因此是不可能的,但是如果我可以通过电子邮件成功运行一个exe,为什么我不能使用参数运行一个exe?这没有道理。

I thought maybe there is a security threat with this approach hence it is not possible, but if I can successfully from an email run an exe, why can I not run an exe with parameters? It doesnt make sense.

感谢您的帮助。

Leo

推荐答案

在没有得到任何适当的回应后,继续我的研究为此没有成功,我将暂时得出结论,我正在寻找是不可能的。如果这个原因不可能涉及安全性,那么我完全不明白为什么运行没有参数的exe,因此认为LESS对运行具有参数的exe有害。当然,exe不要求参数有害。如果任何人都会关心这一点,对我来说这将是有益的,谢谢。

after not getting any suitable responses and after continuing my research for this without success, I will temporarily conclude that what I am looking for is not possible. If the reasons for this not being possible concern security, then I am completely puzzled as to why running an exe without parameters is allowed and therefore considered LESS harmful than running an exe with parameters. Surely, an exe does not require parameters to be harmful. If anyone would care to elaborate on this, it would be educational for me, thank you.

然而,我想到了一个替代我的问题,这不是优雅,否则将在href中陈述参数,但它符合我的目的。因为我们的应用程序是从网络驱动器运行的,所以我改变了它,以便在网络驱动器上创建用户特定的cmd文件,并且它创建的电子邮件中的超链接指向这些cmd而不是exe。这样,cmd文件包含对具有正确参数的exe的调用,并且由于cmd文件非常轻松快速地编写,这是可以的。

Nevertheless, I have thought of an alternative to my problem, which is not as elegant as would otherwise be stating parameters in href, but it serves my purpose. Because our app is run from a network drive, I have changed it so that it creates user-specific cmd files on the network drive and the hyperlink in the email it creates points to these cmd instead of the exe. That way, the cmd files contains the call to the exe with the correct parameters and as the cmd files are very light and quickly written, this is OK.

我以回答的方式关闭,但不是。

I am closing this as "answered", but it is not.

感谢您抽出时间读。

Leo

这篇关于使用参数调用exe的HTML超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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