开发者

run exe from web page?

I want to make a web page that lunches an exe on the server when loaded i tried php:

exec('filename');

but this wont show the gui it only work with console apps

i also tried .net 开发者_开发技巧to do that it worked when debugging but not when using iis any one can help me?


What code did you use in .NET to execute exe? You should use Process class - check MSDN - it also gives an example as to how to use the class to execute the exe. The class allows lot of option such as redirecting standard i/p, o/p. You can even use WaitForExit method to wait till the process is complete.


I've done the same thing using PHP:

exec('cmd.exe /c yourexename.exe',$data,$ret);

where $data is output array and $ret will retur 0 for successful execution and 1 for failure.


If you're just looking for any language that has that capability, I know coldfusion can do that using:

<cfexecute
name="ApplicationName"
arguments="CommandLine Arguments"
OUTPUTfile="Output file name"
timeout="Timeout interval in seconds">


exec();
system(); 

Allows you to execute external programs and get the console output

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜