windows C#。如何以编程方式授予用户登录作为服务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1286795/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C#. How to programmatically grant User Log On as a Service
提问by MaksymD
I've searched through the internet, but haven't found any solution in c#. Does anybody know how to give user right to log on as a Service in c#?
我已经通过互联网进行了搜索,但没有在 c# 中找到任何解决方案。有人知道如何授予用户在 c# 中作为服务登录的权限吗?
采纳答案by GuyBehindtheGuy
回答by No More Hacks
I tried in vain to find this. The way I did it in the end was to package the NTRights executable with my application and then launch it as a separate process.
我徒劳地试图找到这个。我最终的做法是将 NTRights 可执行文件与我的应用程序打包在一起,然后将其作为单独的进程启动。
NTRights can be found on the server 2003 resource kti and its usage is documented here: http://support.microsoft.com/kb/315276
NTRights 可以在 server 2003 资源 kti 上找到,其用法记录在此处:http: //support.microsoft.com/kb/315276