简体   繁体   中英

send data from a C# asp.net web site to an installed C# windows forms app

I'm working on a net based POS system and need to enable silent printing. (Print without displaying the PrintDialog).

I have managed to get it working but at times when cashiers want to generate new vouchers it does not print and this is becoming a problem.

I have been instructed to create a Windows Forms app that will be installed on all of my cashiers machines, what this app needs to do is once the cashiers log onto the website and sells a voucher i need data to be sent from my ASP.NET website to the Windows form application where the silent print can take place, so as soon as the cashiers clicks on the 'Sell Voucher' button the data must be sent to the installed windows app and print automatically.

The data that will be sent to the cashiers machines is basic info like Cashier Name, Account Name, Site...etc

How would i go about achieving this result?

Thank you in advance.

The two apps will probably need to share a single data source (eg using SQL Server).

If the printing needs to happen silently, without user intervention, then you will need to implement a listener (typically as a Windows Service) that waits for new items to be added and are ready to print.

See: Publish-subscribe pattern or, alternatively, Observer Pattern .

Look into WCF or signalr.net

for signalR there is a .net client for easy implementation into a windows app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM