登录时启动winform

编程入门 行业动态 更新时间:2024-10-28 00:16:32
本文介绍了登录时启动winform - 具有管理员权限(c#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个应用程序需要管理员权限,因为处理过程终止 - i需要它在用户登录时启动 $ b $我已经尝试过: - taskschedueler - 但是我的命令行有些问题不够有效

i have an application which requires admin rights due to handling process killing - i need it to start when the user logs-on ive tried: - taskschedueler - but i have a few problems with the command line not being efficient enough

schtasks /create /tn mytaskname /tr "myfilelocation" /RL Highest /sc ONLOGON

- 因为它仍会检查交流适配器选中标记(和/ RL在win-xp机器上无效) - regedit

- since it still checks the "ac-adapter" checkmark amongst others (and /RL doesnt work on win-xp machines) - regedit

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]

这不会启动winform 甚至尝试过 -

this wont start the winform even tried -

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit]

仍无济于事。 i正考虑创建一个Windows服务 - 这真的有点矫枉过正。 所以我的问题是 - 还有其他方式 - 除了taskchedueler,regedit和创建一个Windows服务,这将允许我在启动时使用管理员权限启动winform (清单没有帮助实现这一点btw)

still to no avail. i was thinking about creating a windows service - this seems a bit overkill really. so my question is - is there any other way - besides taskschedueler, regedit and creating a windows service, that will allow me to start the winform with admin rights at startup (manifest doesnt help accomplish this btw)

推荐答案

根据本说明 [ ^ ],Run键应自动启动应用程序。也许你可以在注册表中显示你的条目的确切内容。 According to this note[^] on MSDN, the Run key should automatically start the application. Perhaps you could show the exact content of your entry in the registry.

我认为我找到了一个合适的解决方案 http ://taskscheduler.codeplex [ ^ ] 这是任务schedueler的程序集包装器 - 允许完全自定义设置.. 看起来很简单 i think ive found a move suitable solution taskscheduler.codeplex[^] which is an assembly wrapper for task schedueler - which allows fully customized settings.. seems simple enough

更多推荐

登录时启动winform

本文发布于:2023-11-10 01:45:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574016.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:winform

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!