views:

424

answers:

3

Is there a way to open/close (i.e. start-up/shut-down) a winform application via ASP.NET? I'm sure this reeks of a security violation, but the application of this technique (if it's even possible) would be in a controlled environment.

I assume extra permissions would need to be granted to the web server or the web application, but I'm not sure what the permissions are.

+1  A: 

You're asking about how to do this on the client? I don't think there's any way to start a program using JavaScript.

The best (worst?) you could do would be to use an ActiveX control. Otherwise, you should look into SilverLight.

John Saunders
+1 for ActiveX, but would Silverlight really have enough permission to launch an external app? I didn't think so.
Dennis Palmer
No, I was thinking of replacing the WinForms application with SilverLight.
John Saunders
I've never done any ActiveX programming. By using ActiveX, does it mean that the winform application will display within the web browser, or will it open in it's own window (i.e. as if the user started the program from a menu or shortcut)?
I believe the ActiveX control will have to launch the Windows Forms application. This is one of the reasons ActiveX controls are banned in most companies.
John Saunders
You may be starting to realize why this is a bad idea.
John Saunders
+1  A: 

We were able to accomplish this using a browser plug-in.

Jeremy Bade
+1  A: 

You could use Click Once, it can start via a URL.

Mike D
Click Once is the sure fire way to proceed, if you use Visual Studio .Net, its easy to do. If the user doesn't have the application already installed, it installs into a special area of My Documents, so every user has permission to install the application. You can also setup the application, that it only starts, when the user is online, if you need to access the data for the app from a webserver.So, search about for 'Click Once' deployment.
Mike D
My application is currently a VB6 application, but this idea triggered another idea. Namely, I could create a generic ClickOnce program that will allow me to start up any other program. I can pass the name of the program and any commandline parameters via the ClickOnce URL. Kind of round about way of getting there, but it should work.