简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM