如何在app.manifest XML文件的消息框中写入日志或友好消息 [英] How to write a log or friendly message in message box in app.manifest XML file

查看:208
本文介绍了如何在app.manifest XML文件的消息框中写入日志或友好消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建了一个wpf应用程序,该应用程序已在app.manifest文件中使用requireAdministrator构建.因此,如果用户以普通用户身份打开该应用程序,它将要求管理员凭据才能打开该应用程序.

在这里,我需要以普通用户身份打开该应用程序时向用户显示一条友好的消息,例如您需要管理员特权",或者我可以通过任何方式在app.manifest文件中写入日志?

示例代码:

< requestedPrivileges xmlns ="urn:schemas-microsoft-com:asm.v3">
< requestedExecutionLevel level ="requireAdministrator" uiAccess ="false"/>


任何帮助都会大有帮助.

我尝试过的事情:

我已经用Google搜索了一些解决方案,但是没有运气

Hi,

I have created a wpf application which has built with as requireAdministrator in app.manifest file. So if the user opens the application as a normal user it will ask for admin credential to open the application.

here, I need to display a friendly message to user like "You need admin privilege" when he opens the app as normal user or is that any way I can write a log in app.manifest file?

Sample Code:

<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />


Any help would be much helpful.

What I have tried:

I have googled for some solution, But no luck

推荐答案

否.
海拔高度异常是Windows的固定部分,并且您的应用程序甚至不会在您批准海拔高度要求之前运行您的代码,因此即使它愿意也不会显示任何内容.
老实说,这是一个好主意:如果您能够做到,则恶意代码也可能会试图说服用户这是一种正常行为",该行为会产生阿联酋而不是坏家伙编写的应用程序.
No.
The elevation disalog is a fixed part of windows, and your app doesn''t even run your code until the elevation request is approved so it couldn''t display anything even if it wanted to.
And to be honest, that''s a good idea: if you could do it, so could malicious code which might try to convince the user it''s a "normal action" that produces the UAE instead of the app tyeh bad guys wrote.


这篇关于如何在app.manifest XML文件的消息框中写入日志或友好消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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