How do you send data from an ASP.NET web application to a windows form application?? How do you establish the connection? I looked up webrequest/webresponse/post but i think thats only if you want to communicate between 2 asp.net web applications.
-
In previous comments you have vaguely described what the web application is doing (click a button and send to the windows form), but what is the forms application doing? Why is it a WinForms application? If all it's doing is receiving data, wouldn't a web service be a lot easier to do what you're trying to do? Please give us more information about your overall goal here, because based on this and other questions of yours it sounds like you're really over-complicating things.David– David2010-11-20 12:41:34 +00:00Commented Nov 20, 2010 at 12:41
2 Answers
You might use a socket.
It would help if you're more specific about exactly what you're trying to accomplish. Do you need live communication, or would connecting to a shared database do what you need? Is the web application on the same computer as the server or a different one from the forms application?
Update: If you're trying to pass messages to the Windows Form without using or implementing any sort of protocol, you might look into how to use LISTEN/NOTIFY on PostgreSQL. You could then just add data to a table, then have the forms application consume the data. This would have the added benefit that your forms app wouldn't have to miss any data if it was not on.
3 Comments
My opinion to you is to implement a webservice. I made a project for mobile devices using webservices, the mobiles had an application made in winforms that call a webmethod that made an action which was registered in the system. A web page showed the data and the events of every mobile device.
If you need an explantation of webservices you can go here.
The strategy in your case would be to implement the Observer Pattern or to raise an event to make the application or winform to be noticed about a change or action in the web page.