表单提交要求保存 exe,希望它改为运行

发布于 2024-07-11 20:19:54 字数 407 浏览 4 评论 0原文

当我从 html 文件提交基本表单时,它给了我保存 exe 的选项
我只想运行 exe。 (重新填充模板 html 文件)
提交表单后,我需要做什么才能运行 exe?

<form action="Lib.exe" method=POST ID="Form1">
Enter Index to DELETE<br>
<input type=text name="user" ID="Text1">
<input type=submit value="DELETE">
</form>  

我正在运行一个网络服务器。 html文件和.exe位于运行Web文件的目录中。

任何帮助表示赞赏。

谢谢。

When I submit my basic form from the html file, it gives me the option to save the exe
I just want the exe to run instead. (To re-populate the template html file)
What do I need to do to just run the exe once the form is submitted?

<form action="Lib.exe" method=POST ID="Form1">
Enter Index to DELETE<br>
<input type=text name="user" ID="Text1">
<input type=submit value="DELETE">
</form>  

I am running a web server. The html file and the .exe are in the directory to run web files.

Any help is appreciated.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

合久必婚 2024-07-18 20:19:55

我假设 lib.exe 在服务器上更新其模板,这意味着您需要配置 Web 服务器来运行 exe 文件,而不是将它们提供给用户。 您没有指定您运行的服务器(不知怎的,我假设您运行 IIS...),但在 Apache 中,您可以在 httpd.conf 中使用 来添加exe 的处理程序,类似这样:

<FilesMatch \.cgi
gt;
    SetHandler cgi-script
</FilesMatch>

但适用于 exe。 请参阅此处的 mod_mime 文档

I assume the lib.exe does its template updating on the server, meaning you need to configure your web server to run exe files instead of serving them to the user. You do not specify the server you run (somehow I assume you run IIS...), but in Apache you would use <FilesMatch> in httpd.conf to add a handler for exe, something like this:

<FilesMatch \.cgi
gt;
    SetHandler cgi-script
</FilesMatch>

but adapted to exes. See mod_mime documentation here.

绮烟 2024-07-18 20:19:55
  1. 请澄清你的问题。 操作系统和网络服务器是什么,网络服务器是否以受限权限运行?
  2. 您可以将 Lib.exe 移植到您的网站使用的语言(PHP 或 ASP 或其他语言)吗?
  3. 将服务器端脚本作为 CGI 执行小任务可能会降低系统速度,因为操作系统需要启动新进程、为新进程分配资源等。编译的 C++ 可能比加载模块解释的 PHP 慢。
  1. Please clarify your question. What are the OS and the web-server, does web server run with restricted permissions?
  2. Can you port Lib.exe into the language used by your web-site (PHP or ASP or whatever)?
  3. Executing server side scripts as CGI for small tasks can slow down the system as the OS needs to start a new process, allocate resources for the new process, etc... Compiled C++ can be slower than PHP interpreted by loaded module.
甜是你 2024-07-18 20:19:55

弄清楚了。 我的 CGI 应用程序中没有该内容类型。
“内容类型:text/html”
如果没有这个,网络服务器将不会执行它。 新手错误。 多谢你们。

现在我的html文件在Web服务器上运行,表单调用cgi-bin目录中的exe并执行用户指定的删除。

我的下一个挑战是弄清楚如何在浏览器中不实际显示或转到 Lib.exe。 我希望它按现在的方式运行,但保留在我的 html 页面上,因为它现在已更新。 我不想手动返回我的 html 页面。

Figured it out. I didn't have the content type in the CGI app.
" Content-type: text/html"
Without this the web server won't execute it. Newbie error. Thanks guys.

Now my html file runs on the web server, the form calls the exe in the cgi-bin directory and executes the deletion, specified by the user.

My next challenge is figuring out how to not actually display or go to the Lib.exe in the browser. I want it to run as it's doing, but stay at my html page as it is now updated. i don't want to have to manually go back to my html page.

み青杉依旧 2024-07-18 20:19:55

您可以使用 AJAX 代替表单提交并获得相同的结果。

You can use AJAX instead of form submitting and achieve the same result.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文