2012-07-06 101 views

回答

1

您無法通過輸入url來運行EXE文件。瀏覽器的工作方式,它會要求你下載或保存文件,如果在url結尾處有一個exe文件名(並且服務器上有一個exe文件名)

要運行exe文件的方式你需要它,你可以使用腳本語言,如PHP,ASP或其他。它的工作方式,腳本將查看網址並查看是否包含任何命令。如果找到它,它將使用exec命令執行一個exec文件。下面是一個例子

exec("ping yahoo.com", $output, $return); 
echo "The command returned $return, and output:\n"; 
echo "<pre>"; 
var_dump($output); 
echo "</pre>"; 

輸出

array(12) { 
    [0]=> 
    string(0) "" 
    [1]=> 
    string(55) "Pinging yahoo.com [72.30.38.140] with 32 bytes of data:" 
    [2]=> 
    string(0) "" 
    [3]=> 
    string(51) "Reply from 72.30.38.140: bytes=32 time=313ms TTL=50" 
    [4]=> 
    string(51) "Reply from 72.30.38.140: bytes=32 time=322ms TTL=50" 
    [5]=> 
    string(51) "Reply from 72.30.38.140: bytes=32 time=242ms TTL=50" 
    [6]=> 
    string(51) "Reply from 72.30.38.140: bytes=32 time=260ms TTL=50" 
    [7]=> 
    string(0) "" 
    [8]=> 
    string(33) "Ping statistics for 72.30.38.140:" 
    [9]=> 
    string(56) " Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)," 
    [10]=> 
    string(46) "Approximate round trip times in milli-seconds:" 
    [11]=> 
    string(53) " Minimum = 242ms, Maximum = 322ms, Average = 284ms" 

注意,計劃將其中的網頁託管在服務器計算機上運行。所以如果你輸入http://www.yahoo.com/turn-off-lights。它會關閉雅虎大樓內的燈光,而不是其他任何地方。