我写了一个账户,想在app.config中配置账户和密码,以达到指定账户启动服务
在ProjectInstaller.Designer.cs文件中,我发现只有使用System.ServiceProcess.ServiceAccount.LocalSystem
不会弹出输入账户的框框
好像并不能直接从配置文件中读取
我想达到这样this.FlashConverterServiceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.User;
this.FlashConverterServiceProcessInstaller.Password = ConfigurationManager.AppSettings["Password"];
this.FlashConverterServiceProcessInstaller.Username = string.Format(".\\{0}",ConfigurationManager.AppSettings["UserName"]);
请大家帮忙一下