Hi all,

I have two C# projects (a service and a windows form) on the same solution. I want to send some parameters to the service on click event of the service start (serviceControllr.Start() method)

How can I do that.

Thanks.

When I write a Windows Service, I typically use XML configuration files for communication between the service proper and any auxiliary applications (such as detailed configuration of the service).

The Start method syntax allows you to pass a string array to the onStart event handler of the windows service:

string[] args = new string[2]{"Hello","World"};
            serviceController1.Start(args);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.