Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# FileSystemRights对字符串格式设置的权限_C#_.net 4.0_Posix - Fatal编程技术网

C# FileSystemRights对字符串格式设置的权限

C# FileSystemRights对字符串格式设置的权限,c#,.net-4.0,posix,C#,.net 4.0,Posix,我正在用C#枚举文件/文件夹,并想知道是否有任何库(或更好的.Net功能)可以将属性格式化为类似POSIX的unix文件权限字符串 d--x- 谢谢您的帮助。当您可以打印出实际的字符串描述时,为什么需要编码字符串 FileSystemRights Rights = 0; Rights |= FileSystemRights.CreateFiles; Rights |= FileSystemRights.ExecuteFile; Console.WriteLine(Rights.ToStrin

我正在用C#枚举文件/文件夹,并想知道是否有任何库(或更好的.Net功能)可以将属性格式化为类似POSIX的unix文件权限字符串

d--x-


谢谢您的帮助。

当您可以打印出实际的字符串描述时,为什么需要编码字符串

FileSystemRights Rights = 0;

Rights |= FileSystemRights.CreateFiles;
Rights |= FileSystemRights.ExecuteFile;

Console.WriteLine(Rights.ToString());

// Prints:   CreateFiles, ExecuteFile