![]() |
1
1
It does slightly more than just copying the NTFS permissions. It also copies the attributes of the file. I'm not quite certain whether it copies inherited permissions, though, but run it once and you should be able to find out. Note that copying permissions on and of itself requires special permissions (administrators have these, of course), be sure the process running this method has the required permissions to query, view and set permissions on those objects. |
![]() |
2
2
I tried following the OP suggested pattern for copying a file's ACLs and attributes and found a few issues in our application. Hopefully this information helps others.
根据msdn,使用
It is necessary to make a new
Here is an example of a pattern that works from our app.
After fixing the first issue, then we found the owner attribute was not being copied. Instead, the destination file was owned by Administrator in our case. To get around that the process needs to enable the SE_RESTORE_NAME privilege. 退房
我们必须处理的最后一件事就是UAC。如果用户在UAC下运行,我们需要重新启动具有管理权限的应用程序。这是我们的应用程序的另一个例子,它处理了升级后的应用程序。
Ours was a console app so we need to pass the
In our app we just return after the call to
享受! |
![]() |
JOO · 使用udpClient从多个IP地址连续接收数据 2 年前 |
![]() |
Futterkiste · 函数比例图 2 年前 |
![]() |
user18789895 · 我应该如何验证WinForms应用程序? 2 年前 |
![]() |
beriscen · 如何使整个链接标签区域可点击? 2 年前 |
![]() |
lpmaxim · 当鼠标光标悬停在按钮上时,背景图像会移动 2 年前 |