简体   繁体   中英

Which identity is Topshelf service running as?

There appears to be two ways to specify the identity a Topshelf service. One is in code like these examples:

configure.RunAsLocalSystem();
configure.RunAs("MYDOMAIN\username", "password");

And then there is the user specified in the Services application in Windows, where you right click on the service and select Properties and go to the Log On tab.

Which of these takes precedence? Or are they relating to different things?

服务登录窗口

They refer to the same thing. Topshelf and Services.msc are manipulating the underlying windows service entity.

Both methods will ultimately use the ChangeServiceConfig API function to set the service's the user name and password (or possibly CreateService , when TopShelf is creating).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM