Geeky Ninja
Geeky Ninja

Reputation: 6050

Manage ASP.NET Windows Service from a Web Application (browser)

I have number of windows service (around 10) all are developed in ASP.NET C#. And are installed on Windows Web Server 2008. If I wanted to start or stop the service I have to log in to the Windows Web Server and then Start/Stop the service.

enter image description here

I wanted to manage this activity through a Web Portal which I wants to create in ASP.NET C#.

Does anybody any idea or have any reference that how it can be done?

Upvotes: 1

Views: 3245

Answers (2)

Disappointed
Disappointed

Reputation: 1120

If your web portal will be published on the same machine with services than you can use ServiceController class https://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller(v=vs.110).aspx

Upvotes: 2

vbranden
vbranden

Reputation: 5996

You can create a web service that controls the service via rest calls and run that web service on the server. Then use jquery to make rest calls from a web page ( on that server) using $.post() or $.ajax() or JavaScript native xmlhttprequest

Visual studio web has project templates for web services that can get you started. The service start stop can be using this example

http://www.csharp-examples.net/restart-windows-service/

Upvotes: 2

Related Questions