以管理员身份运行:requireAdministrator&放大器;的ClickOnce +仿真系统时间 [英] Run as administrator: requireAdministrator & ClickOnce + emulating system time

查看:897
本文介绍了以管理员身份运行:requireAdministrator&放大器;的ClickOnce +仿真系统时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用ClickOnce tehcnology。今天,我需要运行它以管理员身份。 requestedExecutionLevel水平=asInvokeruiAccess =FALSE/ I标记从

My app uses ClickOnce tehcnology. Today I needed to run it as administrator. I modified the manifest file from

<requestedExecutionLevel  level="asInvoker" uiAccess="false" />



to

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />



不过VS不能编译项目:

However VS cannot compile the project:

错误35的ClickOnce不支持请求执行级别requireAdministrator。

Error 35 ClickOnce does not support the request execution level 'requireAdministrator'.

我认为这是不可能同时使用它们。难道不是吗?我需要更改系统时间,我能做的,在应用层面?我可以模仿,所以应用程序。可以做我想做的。更改时间2小时然后放回到一秒钟。我有几个DLL和他们所要求的时间。

I think it's impossible to use them at once. Isn't it? I need to change the system time, can I do that in application level? Can I emulate it, so app. can do what I want. I change time +2 hours then put back for a second. I got a few dlls and they ask for time.

推荐答案

时间是一个系统级的东西,你不能改变它只为你的进程。撒谎到您的依赖关系的唯一方法是勾API,使用走弯路或类似的东西。如果你是一个卑微的用户帐户不允许的。

Time is a system-wide thing, you can't change it just for your process. The only way to lie about it to your dependencies is to hook the API, using Detours or something similar. Not allowed if you're a lowly user account.

修改时需要更改系统时间和/或更改时区特权(其中Administrator帐户通常给出)。

Modifying the time requires the "Change the system time" and/or "Change the time zone" privileges (which the Administrator account is normally given).

和由@克里斯提到,管理和ClickOnce的是不兼容的。

And as mentioned by @Chris, admin and ClickOnce aren't compatible.

这篇关于以管理员身份运行:requireAdministrator&放大器;的ClickOnce +仿真系统时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆