gpt4 book ai didi

c# - 如何在c#中将服务安装为当前帐户

转载 作者:行者123 更新时间:2023-11-30 15:07:26 25 4
gpt4 key购买 nike

在我目前使用的安装程序代码中:

 processInstaller.Account = ServiceAccount.LocalSystem;

但我们的一位客户配置了代理,因此服务帐户无法访问互联网。目前我们必须在安装后手动配置所有服务,但如果我们可以让它们自动使用安装用户的凭据,我们就不必这样做了。有谁知道这是否可以做到?

谢谢,理查德

最佳答案

您可以将帐户类型设置为用户,然后指定用户名和密码。

processInstaller.Account = ServiceAccount.User;
processInstaller.User = "domain\username";
processInstaller.Password = "Password";

关于c# - 如何在c#中将服务安装为当前帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6586714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com