Saturday, August 26, 2006

Pass Custom Commands to a Running Windows .Net 2 Service from a WinForm Application

Steve Schofield Weblog - Using Winforms to pass custom commands to a Windows .NET 2.0 Service

"...This article covers a simple “Hello world” application called “AService” using the .Net 2.0 framework. Microsoft has made it very simple to do; this used to be reserved for those who knew C/C++. What does AService do exactly?? Nothing really besides log a few entries in the Application event log. It does have sample code showing how easy it is to pass custom commands using a WinForms application while the .Net service is running. I did not find a “Hello world” application like this so I hope my article helps.

...

In conclusion, you could use a nice front-end application written using Winforms while being able to interact with your .NET service. This article only scratches the surface of what you can do using Winforms and Windows .NET services together. ..."

This is a VB.Net code example that I might be able to use in the future.

The code is short and sweat yet detailed enough to provide a foundation to build from. In hind sight it looks pretty straight forward, but aren't many coding problems?

1 comment:

Anonymous said...

Hey Greg,

I appreciate the link back to my article on sending custom commands to a .NET service from a Winforms app. Although this code is simple it has taken me a few years just to understand all the steps necessary to achieve this. MS has made it dropdead simple. I'm integrating this functionality into my next release of IISLogsSVC. People will be able to run "on demand" from within my Winforms app called IISLogsGUI. This sample app the article is based on helped me understand what code was necessary to integrate into my existing application. I hope you find this useful. As always, thanks for the link to my article, I like your blog name!

Tx,

Steve Schofield
Microsoft MVP - IIS