从浏览器询问服务器ro运行程序 [英] Ask server ro run program from browser

查看:77
本文介绍了从浏览器询问服务器ro运行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我可以在私人使用"网页中放置一些命令来要求服务器启动运行程序(例如,压缩程序来备份文件),这将很有用.

在Linux中,可以看到一个实现,该实现启动另一个shell(sh命令)以从任何位置运行另一个程序.例如,在vi编辑器中,您可以键入!ls列出目录.

我们可以在window 2003服务器环境中的ASP程序内做类似的事情吗-单击一个按钮,服务器将开始按要求执行操作?

rgds,
kfl.

It would be useful if I can put some commands inside my ''private use'' webpage to ask the server to start a to run a program for example, a compress program to backup the file.

In Linux, one ofen see implementation which starts another shell (sh command) to run another program from where ever you are. For example, inside vi editor, you can type !ls to list a directory.

Can we do similar thing inside ASP program in window 2003 server environment - click a button and the server will start to do as asked?

rgds,
kfl.

推荐答案

如果您正在谈论经典的ASP,则可以使用类似以下的内容:

If you''re talking about classic ASP, you can use something like this:

<![CDATA[<% 
    set wshell = CreateObject("WScript.Shell") 
    wshell.run "myProgram.exe" 
    set wshell = nothing 
%>]]> 



如果是ASP.NET,则可以使用以下内容:



If it''s ASP.NET, you can use something like this:

using System.Diagnostics;
...
Process process = new Process
{
     StartInfo = new ProcessStartInfo("myProgram.exe")
};

process.Start();



希望对您有所帮助!



I hope this helps!


这篇关于从浏览器询问服务器ro运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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