简体   繁体   English

在Windows XP上设置目录权限

[英]Set directory permissions on Windows XP

when you right-click on a file or directory in Windows XP and select 'properties' you get the usual windows properties pop-up. 在Windows XP中右键单击文件或目录并选择“属性”时,会弹出通常的Windows属性弹出窗口。 In this pop-up there are two places where you can set file permissions, the first, is in the 'Security' tab, which has checkboxes for 'Full Control', 'Modify', 'Read & Execute' etc. and the second can be found by clicking the 'Advvanced' button at the bottom of the 'Security' tab. 在此弹出窗口中,可以在两个位置设置文件权限,第一个位于“安全性”选项卡中,其中具有“完全控制”,“修改”,“读取和执行”等复选框,第二个可以通过单击“安全”选项卡底部的“高级”按钮找到。

I know how to set the file/directory permissions for the 'Advanced' section programmatically in C# (using .GetAccessControl, .AddAccessRule and .SetAccessControl), but I cannot find a way of programmatically setting the file permissions in the normal 'Security' section of the file properties window. 我知道如何在C#中以编程方式设置“高级”部分的文件/目录权限(使用.GetAccessControl,.AddAccessRule和.SetAccessControl),但是我找不到在常规“安全性”部分以编程方式设置文件权限的方法文件属性窗口。

Can anyone tell me how to do this programmatically in C#? 谁能告诉我如何在C#中以编程方式执行此操作?

These are just different views of the same underlying data - you will need to use the methods you mention to update file permissions. 这些只是相同基础数据的不同视图-您将需要使用上述方法更新文件权限。

Information available here: http://msdn.microsoft.com/en-us/library/system.io.file.setaccesscontrol.aspx 此处提供的信息: http : //msdn.microsoft.com/zh-cn/library/system.io.file.setaccesscontrol.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM