Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to interact between Web App and Windows Form Application

I have a problem where a Web Application needs to (after interaction from the user via Javascript)
   1) open a Windows Forms Application
   2) send a parameter to the app (e.g. an ID)

Correspondingly, the Windows Forms Application should be able to
   1) send parameters back to the Web Application (updating the URL is ok)
   2) open the Web App in a new brower, if it does not exist
If many browser windows are open it's important that the correct one is updated.

Windows Forms Application is in ASP.NET
Browser is IE6+
The applications are controlled and internal for a specific organisation so it's not a question of launching a custom app.

Question A) Is this possible?
Question B) How do I send parameters to an open Windows Forms Application from a Web App?
Question C) If updating the Web App, how do I make sure the right browser is targeted?

like image 596
Bruce Avatar asked Sep 24 '08 08:09

Bruce


People also ask

Are Windows Forms cross platform?

Forms is an open-source cross-platform spiritual successor to Winforms for . NET 6, supporting Windows, Mac, and Linux. If you are looking for an open-source cross-platform spiritual successor to WPF, see Avalonia.

What is the difference between Windows app and web app?

Windows application can only be accessed from a system in which it is installed. A web application can be accessed from any system through the internet. You need an Internet Information Services (IIS) server to run the web application. Windows application can directly be executed on a Windows operating system.


2 Answers

What you're asking for is possible but seems awkward.

Trying to call an application from a web page is not something you could do due to security considerations. You could however make a desktop application which would be associated with a certain type of files and then use content-type on the web page to make sure that your app is called when a URL with this type is opened. It would be similar to the way MS Office handles .doc or .xls documents or the Media Player opens the .mp3 or .wmv files.

The second part (opening a particular web page from your application) is easier. As you should know the address of your web page create a URL string with the parameters you want and open it in default browser (there are plenty of examples on how to do that, a sample is below).

System.Diagnostics.Process.Start("http://example.com?key=value");

If you want to update the page in the already opened browser or use a browser of your choice (i.e. always IE6 instead of Opera or Chrome) then you'll have to do some homework but it's still quite easy.

like image 104
Ilya Kochetov Avatar answered Oct 01 '22 13:10

Ilya Kochetov


PokeIn library connects you desktop application to your web application in real time/per user. Moreover, due to its reverse ajax state management, you could consider both of your applications as one.

like image 35
Zuuum Avatar answered Oct 01 '22 13:10

Zuuum