我正在尝试Full Control通过 C# 将权限(对于 NT 服务帐户)添加到文件夹。但是,没有设置权限,我在这里缺少什么?
var directoryInfo = new DirectoryInfo(@"C:\Test");
var directorySecurity = directoryInfo.GetAccessControl();
directorySecurity.AddAccessRule(new FileSystemAccessRule("NT Service\\FileMoverService",
FileSystemRights.FullControl, AccessControlType.Allow));
directoryInfo.SetAccessControl(directorySecurity);
PIPIONE
DIEA
相关分类