Вопрос

I have a question that will help me understand how stuff works and investigate feasibility of a bigger plan I have in mind.

Simply given - lets assume that all things run locally - I am wondering if it is possible to:

  • create an html page with a form that will prompt the user to enter the local path of an input file inputFile.dat

  • this input file will be fed to a c++ exe program that expects it for input

  • the c++ exe file will run (this exe file depends on libraries etc but lets assume all are local here)

  • ... and will output the result on screen

It sounds simple, but is it?

Many thanks folks!

Это было полезно?

Решение

Yes, this is definitely possible, if you want to use PHP or some other scripting language.

  • Create a form on your web page
    • Add the directory of the program
    • Add the directory of the data
  • When submitted, use the PHP (or other language) exec function (docs) to execute the program, with the supplied data as argument
  • The exec function returns output from the program.
  • Display the output as wished on your page.

Good luck!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top