0

I write a windows service and a installer project using C# with Visual Studio 2010.

This service will get some data from database.

There're more than one database with different windows domain login account.

I want the installer pass the connection string as a parameters to each service instance, each instance has different service name.

I look into MSDN and see OnStart(string[] args). It needs to write register keys to make a service run with parameters automatically. Is there any other easy ways to do that?

Beside, I set username and password value to null in my installer project. A dialog will be promoted during the installation. But it's only once. I want to set different credentials for each service instance. So it needs to be promotes many times.

Thank you.

4

1 回答 1

0

而是根据需要安装尽可能多的实例并使用connectionStrings配置文件中的部分。

我有一个通用主机(请参阅:http ://shuttle.codeplex.com/SourceControl/changeset/view/ba9750ca1f7a#Shuttle.Core%2fsource%2fShuttle.Core.Host%2fHost.cs ),它允许您轻松实现多个实例服务或将您的代码作为控制台应用程序运行。

高温高压

于 2012-04-19T12:21:42.197 回答