简体   繁体   English

Windows Service在运行.exe文件时的局限性

[英]Limitations of Windows Service on run the .exe file

I 'm trying to get Certificates from a external device using windows-Service . 我正在尝试使用Windows-Service从外部设备获取证书。 how should a handle limitations for current user? 当前用户应该如何处理限制?

I have an .exe file that get certificates from an extra device(Token) and it work correctly . 我有一个.exe文件,它从额外的设备(令牌)获取证书,并且可以正常工作。 but when it called from my windows service using WCF , it doesn't show me all certificates . 但是当它使用WCF从我的Windows服务中调用时,它不会向我显示所有证书。 Does it make a limitation for user or app? 它对用户或应用程序有限制吗?

static void LaunchCommandLineApp()
    {
        var path = AppDomain.CurrentDomain.BaseDirectory + 
        @"GetCertificate.exe";
        log.Info("LaunchCommandLineApp basePath is : " + 
        AppDomain.CurrentDomain.BaseDirectory);
        log.Info("LaunchCommandLineApp path is : " + path);
        ApplicationLoader.PROCESS_INFORMATION prcInf = new 
        ApplicationLoader.PROCESS_INFORMATION();
        ApplicationLoader.StartProcessAndBypassUAC(path + " -Verb runAs", 
        out prcInf);
        log.Info("After StartProcessAndBypassUAC");
    }

I think your problem is Windows Service User Account that cause your exe run as that user not current user. 我认为您的问题是Windows Service User Account ,导致您的exe以该用户(不是当前用户)身份运行。 read more about Windows Service user accounts . 阅读有关Windows Service用户帐户的更多信息

And for Run a process from a windows service as the current user. 并且用于以当前用户身份通过​​Windows服务运行进程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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