tags:

views:

188

answers:

8

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 parameters to the program.


We have 2 program, one is a web app, the other is a desktop program. We want to find a simple way to integrate the 2. That's why we need to execute the desktop program from a web page.

+3  A: 

This isn't possible for blatantly obvious security reasons.

Lloyd
+5  A: 

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?

Sardaukar
+1 for the web service suggestion
Tiberiu Ana
That would mean the desktop client must keep pinging the server, and therefore that it must be running all the time. The question is how to *execute* that program.
Kobi
+1  A: 

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

+1  A: 

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

Darin Dimitrov
activeX is such a security problem i wouldn't ever recommend it
dusoft
A: 

As already said, since SP2, I believe, this is not possible because it is a huge security issue.

However, for our company intranet we had the requirement to create a list of links which started all kinds of applications. I wrote an applet which handles these 'special links' and allows execuables to be started or folders to be opened etc. As this is all under our control we consider the security problem can be ignored.

paul
+10  A: 

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.

Miles
+1  A: 

This method should probably work if you are running on Windows machine that has IIS.
Set up a Web Service (for example using Windows Communication Foundation) on the local machine that exposes a method that runs local applications.
Call that method from the webpage.

Przemek
+4  A: 

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.

Adam Goode
That's an interesting idea. Nice one. The file can be an XML file, for example, that contains some data. It would work nicely if you can configure the browser to open the file automatically, but can get annoying if users are promped to `save / open` the document.
Kobi