How do I configure the name of a Windows service upon installation (or easily at compile time)?

前端 未结 3 1938
半阙折子戏
半阙折子戏 2020-12-13 07:06

I\'ve created a Windows service in C#, installed it on a server and it is running fine.

Now I want to install the same service again, but running from a different wo

3条回答
  •  一向
    一向 (楼主)
    2020-12-13 07:34

    Instead of using Environment.GetCommandLineArgs(); the class Installer has a property called Context from which you can access command line arguments passed to InstallUtil structured in a nice StringDictionary.

提交回复
热议问题