If I have a link in my page of the form:
<A HREF="/executable.exe?param=1">Run</A>
Are the parameters after the "?" passed to the executable after the browser has downloaded the executable, and the user 开发者_C百科has chosen to run the executable?
I have examined argv, and the environment, but doesn't seem to be there.
Is there any other place where the browser might be passing the parameters to the executable?
The parameters are just part of the url request.
What is done server side with it is completely up to you.
But if you expect the client to execute the file with those params, it will not work.
The file won't be executed at all but only downloaded, and that probably with a warning (in modern systems)
Once the file is Downloaded and the client executes it, it is just up the the client how he executes it. Nothing to do with your params any more
There is however a hack in early versions of internet explorer 5 or even 6 but I won't talk about that here because it has no relevancy any more and is only an harmful expoit.
Link it to .cmd or a bat file which has the command to execute executable.exe with parameters.
So, your link should lookl ike
<a href ="/someth.cmd> Run me </a>
and the .cmd file should contain
executable.exe param1 param2
Hope it helps.
精彩评论