Adi
Adi

Reputation: 1455

How to communicate to windows service from Asp.net application

I have a windows service which is listening on ip address and port number to dump the data into text file.Now i want the status of the windows service running like connection is correct,data is getting dumped,path of the file etc to be shown in Web application. Now my concern is can i communicate to the method of the windows Service running on Operating system.

Please help me with your valuable suggestions. Thanks in advance.

Upvotes: 0

Views: 1583

Answers (1)

Ehsan
Ehsan

Reputation: 32651

One possible way of doing this to use WebClient. You can send the details to your asp.net application using webclient with all the information you want.

The WebClient class provides common methods for sending data to or receiving data from any local, intranet, or Internet resource identified by a URI. The WebClient class uses the WebRequest class to provide access to resources. WebClient instances can access data with any WebRequest descendant registered with the WebRequest.RegisterPrefix method.

Alternatively, you can also write all the information to some common database table, and let the windows service write to it and asp.net application read from there.

Upvotes: 1

Related Questions