How to run a executable file from a web page?

前端 未结 8 2094
暗喜
暗喜 2021-01-03 14:47

What I mean is, when user click a button on a webpage, a program which has already installed on his computer would be executed. I also need to pass some command line para

相关标签:
8条回答
  • 2021-01-03 14:56

    This isn't possible for blatantly obvious security reasons.

    0 讨论(0)
  • 2021-01-03 14:58

    Make a central database, tell your destop app to connect to that while web app will be connecting to that too .. so they can meet in the park

    0 讨论(0)
  • 2021-01-03 15:07

    You can register a protocol to your application so that navigating to a URL beginning with that scheme will launch your application and run a command.

    • [Windows](http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx)
    • Mac OS X
    • Gnome
    0 讨论(0)
  • 2021-01-03 15:15

    If your clients use Internet Explorer you could write an ActiveX control.

    0 讨论(0)
  • 2021-01-03 15:17

    This is not possible. If it was, it would be a huge security breach.

    Imagine being able to let the user click a button on the webpage and as a result format his harddrive with the standard format command? I bet you wouldn't want that happening to yourself.

    Maybe you can think about exposing a webservice from your webapplication and let the desktopclient look at that webservice?

    0 讨论(0)
  • 2021-01-03 15:17

    The way to do it is to register a MIME type handler for your application that is installed on the desktop. This is straightforward but different for each platform. Then, when you want to have the program run, you send a document to the user of your given MIME type.

    0 讨论(0)
提交回复
热议问题