How can I add a manifest (for UAC support) to my VB.NET application?

时光怂恿深爱的人放手 提交于 2019-11-27 07:27:36

问题


How can I add and embed a manifest file in VB.NET, in order to add UAC support to my application?


回答1:


In VB.NET 2010, go to Project → My Project → Application→ View Windows Settings.

You'll see the default manifest. From here, you can change it as you desire.

For example, in this case, to require UAC elevation when the application launches, change:

requestedExecutionLevel level="asInvoker" uiAccess="false"  

to

requestedExecutionLevel level="requireAdministrator" uiAccess="false"   



回答2:


You have to add a manifest specifying the privileges you require.

Choose Project->Add New Item..., and select Application Manifest File.

A sample manifest file will be created containing a <requestedExecutionLevel> entry and an explanation what to do with it.

This only works with Visual Studio 2008 (and probably later).

To add the manifest to 2005, this blog entry might help. It looks rather complicated.



来源:https://stackoverflow.com/questions/1431948/how-can-i-add-a-manifest-for-uac-support-to-my-vb-net-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!