How to make interaction from WEB application to client machines

0

I have a WEB application in ASP.NET MVC which is an intranet project. I would like to add some functionality in it to make it easier to work with Backup's.

I already have a WIDNOWSFORMS APPLICATION that executes user-aware backups and saves them to a server on the network. And also the same application only in the form of WINDOWS SERVICE which makes the backups automatically at a certain time and also saves them to a server on the network.

Each of the applications serves in one scenario, but what I'm wanting is: Integrating the Application ASP.NET MVC to when, for example, I want to back up drivers of a certain machine from a user, I select this option in the Application WEB, it sends the message (Somehow to the machine, I think it can communicate with the service) and the machine does the Backup and saves it on the server.

How can I do this, via WEB API, some other way?

    
asked by anonymous 07.10.2016 / 23:29

1 answer

0

I understand that you want to "automate" some processes that already exist and that today require human interaction to be performed or simply YOU, not the user, indicate when to do it.

As this should start from the web application and received by the desktop application, I believe that creating a windows service "Windows Service" in C # on the client will solve your problem.

In the web application you inform what should be done (save this in a database table) and the Windows Service application on the client from time to time verifies and processes that information (s) .

  • For security, create a "Web Service" for reading this "table" (do not leave database connection information on the client).

  • Use a token to validate access to the Web Service

  • Put a time interval that meets your needs, which does not cause unnecessary database connections and overhead on the client machine.

Tip to run the application in a time range:

do
{
    ProcessaAcoes();
    Thread.Sleep(1000 * 60 * 60 * 2); //de 2 em 2 horas
} while (true);
    
08.10.2016 / 21:02