How can i send data from asp.net web application to windows application and forth?

Recommended Answers

All 20 Replies

If you tell us how you want the flow of your programs/data to be, then perhaps we can guide you. Are both running on the same machine?

I think the easiest way is writing files to disk or on a database and the most "decent" way is using windows services.

The web application and the windows app can both point to the same database. That is definately one way of getting data between the two. Its a common approach that you will see implemented as well.

I want the web application to send message to windows application then gets the response back from it , if i used database how can i let any of the application knows that a data is sent to database. They are not running on the same machine. Will WCF be suitable in the situation
Thank you all for your replies

Look into Message Queues. The advantage is that they are persistent, so notifications are saved when the application isn't running, or the computer is down.

i looked into Message Queues but applications have to be running under microsoft system.
which is better sockets or WCF

i looked into Message Queues but applications have to be running under microsoft system.

It is from Microsoft: MSMQ on MSDN

Am sure WCF is much better to control than sending data over sockets.

Is there any simpler method than WCF, it seems very complicated to configure

Be a little more specific about the kind of data you are sending. I still think a message queue is a good option.

The web application is a voting server , i want it to pass ballots to other servers in the system to admin application to get signature and to counter application to make tally

well I would state some ways that you can do this.
You can use sockets. The windows application can communication through raw sockets with your web application. But you would also have to open a socket connection on your web application. I have used a java application to communicate with a php webserver before through socket. My java application was the client during the connection.

another means is HTTP. sending messages from your desktop application to your web application through HTTP. Well I did this while I was doing java so I suggest you research on how c sharp desktop app can send messages and recieve from a web app through HTTP. Note that HTTP is an high level means built on sockets. You web browsers is an example of a desktop application that communications with a web server.

The third and this is the easiet of all. Is is the new library in the asp.net SignalR library I would recommend that you use this. This is very easy believe me. I have actually tried this. It is the best means of all. You can connect your web desktop gui or cui to your web and even your mobile. SignalR is the bomb cos it is work on socket. It gives you a very simple api that allows you to consume it own services for realtime application.

Thank you for reply and for help, just found SignalR library i think i'll go for it
thanks again

Will it be possible to transfer data from web application to windows application ?

According to SignalR library , it allows two way communication so it is supposed to send data from web application to windows application http://signalr.net/

Can we exchange data between two different projects of web application and windows applications ?

The names of the variables should be same while sharing the data between web and windows applications ?

No, that's not how it works. See their website.

signalR is the boomb dudes

signalR sounds a good solution , but i still cann't find how it works if the server and client are asp.net application and a desktop application , as all examples makes the server web application and the client an html page on the application. Does anyone has a different example

Guys, Do i have to build a third application to host a signalR server that can manage communication between the two applications. Is this what i need

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.