我使用包“https://pkg.go.dev/github.com/kardianos/service”來運行用Go編寫的應用程序作為Windows服務。我在 中設置了以下屬性:service.ConfigUsername: "myusername"
Option: service.KeyValue{"password": "mypassword"}當我然后安裝程序時,我收到以下錯誤:The account name is invalid or does not exist, or the password is invalid for the account name specified.如何設置 的屬性以使服務在安裝時使用指定的憑據正常運行?service.Config
1 回答

白衣染霜花
TA貢獻1796條經驗 獲得超10個贊
我自己剛剛找到了解決方案。
Username:`DESKTOP-XXXXXX\myAcount` Option: service.KeyValue{"password": "mypassword"}
- 1 回答
- 0 關注
- 229 瀏覽
添加回答
舉報
0/150
提交
取消