从网站上运行一个.exe [英] Running an .exe from a website

查看:176
本文介绍了从网站上运行一个.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个做我的服务器上的一些修的工作,一个exe文件。 我希望能够从位于服务器上的网站启动它。 exe文件,必须在服务器本身和客户端不上启动。

I've created an exe file that does some maintainance work on my server. I want to be able to launch it from the website that sits on the server. The exe has to be launched on the server itself and not on the client.

我的直觉告诉我,这是不可能的,但我不得不请与你们。

My instincts tell me it's not possible but I've had to check with you guys.

如果我需要设置一定的权限/安全性 - 我能

If I need to set certain permissions / security - I can.

推荐答案

一个很粗糙的选项,假设IIS:改变从仅脚本或无到脚本和可执行文件

A very crude option, Assuming IIS: Change Execute Access from "Scripts Only" or "None" to "Scripts and Executables"

为了使这个减去原油,你应该有可执行实现一个CGI接口(如果这是你的控制之下。

To make this less crude, you should have the executable implement a CGI interface (if that is under your control.

而且,如果你想使用ASP.NET添加autorization /认证,在code(C#)来完成,这将是:

And, if you want to use ASP.NET to add autorization/authentication, the code (C#) to do this would be:

System.Diagnostics.Process process;

var startInfo = New System.Diagnostics.ProcessStartInfo("C:\file.exe")

process.StartInfo = startInfo;
process.Start();
process.WaitForExit();

这篇关于从网站上运行一个.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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