请求在运行时写入 Program Files 目录的权限
我现在的处境是我的程序需要访问权限才能写入Program Files 目录。据我所知,应用程序似乎可以在运行时请求这种权限(屏幕会变暗,并且会弹出一个带有“继续”和“取消”按钮的框),尽管我不确定我有什么要做的事情会导致这个弹出。
如果有人可以提供帮助,那就太好了。
I'm in a position right now where my program needs access to write to the Program Files directory. From what I can tell, it seems like applications can request this kind of permission while they're running (the screen will go dark, and a box will pop up with Continue and Cancel buttons), although I'm not sure what I have to do to cause this to pop up.
If anyone can help, that would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题已经被问过并回答过好几次了。
简而言之,您只能通过 COM 或启动另一个进程来完成此操作。
请参阅此问题:如果路径受保护,请求 Windows Vista UAC 提升?
This has been asked and answered several times.
The short answer is, you can only do it through COM or launching another process.
See this question: Request Windows Vista UAC elevation if path is protected?