如何给我的C#应用​​程序的管理权限?清单文件

编程入门 行业动态 更新时间:2024-10-25 18:30:20
本文介绍了如何给我的C#应用​​程序的管理权限?清单文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一些麻烦,我的C#应用​​程序使用win32_networkingadapterconfig。问题是,当我使用的应用程序上不具有管理员权限的用户,我不能使用改变功能win32_networkingadapterconfig。我曾经试图以管理员身份运行,但没有运气。我试图做一个manifestfile与在trustInfo部分此内容:

I'm having some trouble with my C# app that uses win32_networkingadapterconfig. The problem is that I can't use the altering functions in win32_networkingadapterconfig when I use the app on a user that dont have admin rights. I have tried to "run as administrator", but no luck. And I have tried to make a manifestfile with this content in the trustInfo part:

<security> <applicationRequestMinimum> <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" /> <defaultAssemblyRequest permissionSetReference="Custom" /> </applicationRequestMinimum> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security>

启用clickone安全设置被设置为完全信任。我在做什么错了?

Enable clickone security settings are set to full trust. What am I doing wrong ?

推荐答案

有在你的代码片段一个trustinfo晃来晃去。使它看起来是这样的:

There's a "trustinfo" dangling in your snippet. Make it look like this:

<?xml version="1.0" encoding="utf-8"?> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="www.w3/2001/XMLSchema-instance"> <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> </asmv1:assembly>

更多推荐

如何给我的C#应用​​程序的管理权限?清单文件

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

发布评论

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

>www.elefans.com

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