Skip to content

WPF 以管理员身份运行

L edited this page Mar 28, 2021 · 2 revisions

添加新文件Application Manifest File
requestedExecutionLevel的level从asInvoker改成requireAdministrator

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

修改后:

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

参考资料

How to force a WPF application to run in Administrator mode
Step 6: Create and Embed an Application Manifest (UAC)

Clone this wiki locally